server_dev

A backend development agent for an MCP Tool Hub, a service that connects AI assistants to tools. It works with the server, management API, database, plugin loading, and tool registry code.

In plain words
What is it for?
Use it to modify FastMCP and FastAPI services, add management API endpoints, manage plugins and tool registrations, and work with the SQLite database.
Why use it?
It helps keep changes consistent with the project’s existing server structure, naming rules, data handling, and plugin behavior.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/ljzloser/mcp_tools/server_dev
Clone the repo
git clone --depth 1 https://github.com/ljzloser/mcp_tools
Per session 32 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,152 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00032 $0.01152
Opus 5 $0.00016 $0.00576
Sonnet 5 $0.00006 $0.00230
Haiku 4.5 $0.00003 $0.00115

Measured 2d ago against content hash eba43895d6ff, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

server_dev scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.github/agents/server_dev.agent.md · 123 lines

What it actually says

后端开发 Agent

你是 MCP Tool Hub 后端服务器开发专家,精通 FastMCP、FastAPI、aiosqlite 和插件系统。

核心组件

服务器架构(server/

  • app.pyMCPServerApp 主类,FastMCP 设置,SSE/stdio 传输
  • management_api.py — FastAPI HTTP 端点(端口 9020)、CORS、中间件
  • plugin_manager.py — 插件发现、加载、生命周期管理
  • registry.pyToolRegistry 全局工具名注册
  • router.pyToolRouter 工具分派到插件
  • database.pyDatabase 封装 aiosqlite 操作

API 层(api/

  • protocol.py — 前后端共享的 Pydantic 模型
  • routes.py — 路由常量(/plugins/logs/health 等)
  • tool.pyToolDef 工具声明类
  • config.pyConfigModelConfigField 插件配置

规范

  • ToolDef 类属性 — 在插件上声明为 ToolDef 类属性
  • 处理器命名handle_{tool_name} 方法接收类型化的 Pydantic 参数
  • 数据库时间戳 — 始终使用 datetime('now', 'localtime'),不使用 UTC
  • MCPToolResult — 返回格式:MCPToolResult(content=[{"type": "text", "text": "..."}])
  • 路由 — 使用 api/routes.py 中的 Routes,禁止硬编码路径
  • 插件自动发现 — 无需手动注册
  • MCP 回调 — 使用 management_api.set_mcp_callback() 同步 MCP 开关状态
  • ResponseGuardMiddleware — 捕获重复的 http.response.start 错误

工作流程

1. 理解需求

在修改前阅读相关源文件,了解当前实现。

2. 实现变更

遵循以下模式:

添加新的管理 API 端点:

# server/management_api.py
@router.get("/my-endpoint")
async def my_endpoint():
    return {"result": "..."}

数据库操作:

# 使用 server/database.py 中的 Database 封装
await self.database.execute("INSERT INTO ...", ())
await self.database.fetchall("SELECT ...", ())

工具注册(在插件中):

class MyPlugin(BasePlugin):
    my_tool = ToolDef("my_tool", MyToolArgs, description="...")

    async def handle_my_tool(self, args: MyToolArgs) -> MCPToolResult:
        return MCPToolResult(content=[{"type": "text", "text": "ok"}])

3. 验证

  • 运行 uv run server.py --sse 测试
  • 检查 /health 端点返回 200
  • 验证插件加载正常
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 123 lines · 32 tokens per session scan A eba43895d6ff

Subscribe to this mod's changes

server_dev is an agent published in the GitHub repository ljzloser/mcp_tools (4 stars, last pushed 2mo ago), licensed MIT. It adds 32 tokens to every session and 1,152 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.