EAG MCP Demo
EAG v3 — 带有 Prefab UI 的 MCP 演示
一个 FastMCP 服务器,包含三个工具,分别用于 (1) 互联网访问,(2) 本地文件 CRUD,以及 (3) 通过 Prefab 实现的生成式 UI。专为在 Claude Desktop 中运行而设计。
工具
工具 | 类型 | 用途 |
| 互联网 | DuckDuckGo 即时答案 API — 返回摘要 + 相关主题 |
| 本地 CRUD | 单一工具,通过 |
| UI | 将保存的笔记渲染为 Prefab 卡片网格(使用 |
Related MCP server: MCP + CrewAI Agentic Integration
设置
需要 uv (brew install uv) 和 Claude Desktop。
cd /Users/nitingangwar/Documents/Code/eagv3/mcp
uv sync连接到 Claude Desktop
编辑 ~/Library/Application Support/Claude/claude_desktop_config.json 并添加(或合并) mcpServers 块:
{
"mcpServers": {
"eag-mcp-demo": {
"command": "/opt/homebrew/bin/uv",
"args": [
"run",
"--directory",
"/Users/nitingangwar/Documents/Code/eagv3/mcp",
"python",
"server.py"
]
}
}
}重启 Claude Desktop。MCP 指示器应显示 eag-mcp-demo 以及三个工具。
纯 Python 回退(无 uv)
python3 -m venv .venv
.venv/bin/pip install -e .然后在 Claude Desktop 配置中使用:
"command": "/Users/nitingangwar/Documents/Code/eagv3/mcp/.venv/bin/python",
"args": ["/Users/nitingangwar/Documents/Code/eagv3/mcp/server.py"]演示提示词
在服务器连接后,将此内容粘贴到 Claude Desktop 中:
通过网页搜索查找 Tata Sons 的所有权详情,将 2-3 句摘要保存到我的笔记文件中,键名为
tata_sons,然后打开仪表板以便我查看。
预期行为:
web_search("Tata Sons ownership")→ DDG 摘要。notes_file("create", "tata_sons", "<summary>")→ 写入notes.json。show_dashboard()→ 内联渲染一个包含一张卡片的 Prefab 卡片网格。
换一家公司(例如“Reliance Industries”)重新运行,仪表板现在会显示两张卡片。
冒烟测试
# Server starts and blocks on stdin (correct):
uv run python server.py
# Or interactive inspector:
npx @modelcontextprotocol/inspector uv run python server.py在检查器中:列出工具,调用 web_search("Tata Sons"),然后调用 notes_file("create", "x", "y") 并确认 notes.json 在磁盘上已更新。
回退方案
Prefab 渲染器未启动(Claude Desktop 返回 JSON 而不是 UI):将
show_dashboard装饰器从@mcp.tool(app=True)更改为普通的@mcp.tool,并使其返回一个由notes.json构建的 Markdown 表格。DuckDuckGo 查询返回为空:DDG 仅对知名实体提供即时答案。演示时请使用著名的公司/人物/地点。
文件
server.py # FastMCP server with the 3 tools
notes.json # backing store for notes_file (starts as {})
pyproject.toml # deps: fastmcp[apps], prefab-ui==0.19.1, httpxAvailable Tools
3 toolsnotes_fileA
CRUD on local notes.json.
Actions:
create - add a new note: action='create', key='foo', content='...'
read - fetch one note: action='read', key='foo'
update - replace existing: action='update', key='foo', content='...'
delete - remove a note: action='delete', key='foo'
list - list all keys: action='list'
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | ||
| key | No | ||
| content | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must fully disclose behavioral traits. It lists actions but does not mention potential destructive effects (update/delete), error handling, atomicity, or file locking. The transparency is minimal beyond basic CRUD semantics.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise, with a single introductory line followed by a list of actions and examples. Every sentence serves a purpose, and the structure is front-loaded with the core purpose.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity (3 parameters, output schema present), the description covers the action parameter well. However, it does not clarify behavior for empty 'key' or 'content' defaults, nor potential side effects. Still, it is largely complete for a basic CRUD tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema has 0% description coverage, but the description adds meaningful context by providing examples for each action, clarifying how 'key' and 'content' are used per action. This adds value beyond the schema definition.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states 'CRUD on local notes.json' and enumerates each action with examples, making the tool's purpose unmistakable. It is distinct from siblings 'show_dashboard' and 'web_search'.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implicitly conveys when to use the tool (to manage notes), but does not provide explicit guidance on when not to use it or discuss alternatives. Given the unrelated siblings, no confusion arises, but explicit exclusions are absent.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
show_dashboardA
Render saved notes as a Prefab card grid.
Call this AFTER saving notes via notes_file to display them visually
to the user. Reads notes.json fresh on each call.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Despite no annotations, the description discloses that it reads notes.json fresh on each call, informing the agent about data source and potential performance. Missing edge cases like missing notes.json, but sufficient for a simple tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences with no redundancy. Front-loaded purpose, then usage and behavior. Every sentence adds value.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a zero-param, no-output-schema tool, the description covers main action, usage context, and a behavioral trait. Misses what happens when no notes exist, but overall adequate.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
No parameters exist, so schema coverage is 100%. The description provides no extra param info, but baseline for zero-param tools is 4.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool renders saved notes as a Prefab card grid. It uses a specific verb-resource combination and distinguishes itself from siblings (notes_file for saving, web_search unrelated).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly instructs to call AFTER saving via notes_file, establishing a clear ordering and naming the prerequisite sibling. This guides the agent on when to invoke the tool.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
web_searchA
Search the web via DuckDuckGo Instant Answer API.
Returns a plain-text block with the abstract, source URL, and top related topics. Best for well-known entities (companies, people, places). Returns 'no results' if the query has no instant answer.
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Without annotations, the description discloses the return format (plain-text block with abstract, source URL, topics) and behavior for no results. However, it omits API limitations, rate limits, and whether the operation is read-only.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three concise sentences, front-loaded with purpose. Every sentence adds value with no redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool has an output schema (not shown), reducing the need to describe return values. The description covers usage context and edge cases adequately for a simple single-parameter search tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema has one parameter 'query' with no description (0% coverage). The description does not elaborate on query semantics beyond implying a search term, failing to add meaningful guidance.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool searches the web via DuckDuckGo API, specifying the output format and appropriate use cases (well-known entities). This differentiates it from sibling tools like notes_file or show_dashboard.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides a clear context for when to use the tool ('Best for well-known entities'), but does not explicitly exclude or compare to alternatives. Given unrelated siblings, this is sufficient.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
3 tool updates
v0.1.0- First observed
notes_file - First observed
show_dashboard - First observed
web_search
TDQS
Scored across 3 tools
The three tools cover completely different areas: local note CRUD (notes_file), visual dashboard (show_dashboard), and external web search (web_search). There is no overlap or ambiguity.
All tool names use snake_case and are descriptive, though the pattern varies slightly (notes_file is a noun, show_dashboard is verb+noun, web_search is noun+verb). Still consistent and readable.
With only 3 tools, the set is small but well-suited for a demo server. Each tool has a clear purpose and none feel redundant. A few more tools might be expected for a full-featured service, but for a demo it's appropriate.
The notes_file tool provides full CRUD and listing, show_dashboard adds visualization, and web_search covers external search. There are no obvious gaps for the stated demo purpose.
Maintenance
Related MCP Connectors
MCP server that lets your AI assistant build and deploy apps, hosting each one at a live URL.
MCP server for building and testing AI agents with multi-model experimentation and insights.
MCP server unifying ERPs, CRMs, APIs and knowledge base for Claude, ChatGPT and Gemini.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA FastMCP-based server that supports SSE real-time event streaming and tool calling, with features for text-to-JSON conversion and grouping text by JSON templates.MIT
- FlicenseBqualityDmaintenanceA FastMCP server providing real-time weather, news retrieval, and local note management tools for autonomous CrewAI agents. It enables context-aware multi-agent workflows with observability and high-speed inference integration.4-
- AlicenseAqualityAmaintenanceA storage and retrieval MCP server for AI agents using FastMCP, enabling persistent knowledge base with semantic search and automatic linking.3120 PyPI339MIT
- AlicenseNot gradedqualityBmaintenanceMCP server providing persistent memory, semantic search, versioned storage, webhook fanout, and unified LLM routing for AI agents via FastAPI runtime with multiple backend options.35Apache 2.0