fastmcp
यह क्या करती है
यह FastMCP से Python में MCP सर्वर बनाने, उसे स्थानीय रूप से जाँचने और AI क्लाइंट्स में इंस्टॉल करने के चरण बताती है। यह उन डेवलपर्स के लिए है जो अपने टूल्स को AI सहायकों से जोड़ना चाहते हैं।
कब इस्तेमाल करें
- ✓जब आप Python में नया MCP सर्वर बनाना चाहें।
- ✓जब आप किसी API, डेटाबेस या command line टूल को MCP टूल्स के रूप में लपेटना चाहें।
- ✓जब आप सर्वर को किसी क्लाइंट से जोड़ने से पहले उसे स्थानीय रूप से जाँचना चाहें।
Skill का लिंक
https://github.com/NousResearch/hermes-agent/blob/main/optional-skills/mcp/fastmcp/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“Python में एक छोटा MCP सर्वर बनाइए, जिससे मेरा सहायक हमारे SQLite सेल्स डेटाबेस को केवल-पढ़ने के मोड में क्वेरी कर सके।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
एजेंट REST wrapper, डेटाबेस सर्वर या फ़ाइल प्रोसेसर जैसे टेम्पलेट से शुरू करता है, फिर टूल्स जोड़ता है और FastMCP command line से सर्वर की जाँच करता है। इसके बाद वह सर्वर को Claude Code जैसे क्लाइंट में इंस्टॉल कर सकता है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
FastMCP
Build MCP servers in Python with FastMCP, validate them locally, install them into MCP clients, and deploy them as HTTP endpoints.
When to Use
Use this skill when the task is to:
- create a new MCP server in Python
- wrap an API, database, CLI, or file-processing workflow as MCP tools
- expose resources or prompts in addition to tools
- smoke-test a server with the FastMCP CLI before wiring it into Hermes or another client
- install a server into Claude Code, Claude Desktop, Cursor, or a similar MCP client
- prepare a FastMCP server repo for HTTP deployment
Use native-mcp when the server already exists and only needs to be connected to Hermes. Use mcporter when the goal is ad-hoc CLI access to an existing MCP server instead of building one.
Prerequisites
Install FastMCP in the working environment first:
pip install fastmcp
fastmcp version
For the API template, install httpx if it is not already present:
pip install httpx
Included Files
Templates
templates/api_wrapper.py- REST API wrapper with auth header supporttemplates/database_server.py- read-only SQLite query servertemplates/file_processor.py- text-file inspection and search server
Scripts
scripts/scaffold_fastmcp.py- copy a starter template and replace the server name placeholder
References
references/fastmcp-cli.md- FastMCP CLI workflow, installation targets, and deployment checks
Workflow
1. Pick the Smallest Viable Server Shape
Choose the narrowest useful surface area first:
- API wrapper: start with 1-3 high-value endpoints, not the whole API
- database server: expose read-only introspection and a constrained query path
- file processor: expose deterministic operations with explicit path arguments
- prompts/resources: add only when the client needs reusable prompt templates or discoverable documents
Prefer a thin server with good names, docstrings, and schemas over a large server with vague tools.
2. Scaffold from a Template
Copy a template directly or use the scaffold helper:
python ~/.hermes/skills/mcp/fastmcp/scripts/scaffold_fastmcp.py \
--template api_wrapper \
--name "Acme API" \
--output ./acme_server.py
Available templates:
python ~/.hermes/skills/mcp/fastmcp/scripts/scaffold_fastmcp.py --list
If copying manually, replace __SERVER_NAME__ with a real server name.
3. Implement Tools First
Start with @mcp.tool functions before adding resources or prompts.
Rules for tool design:
- Give every tool a concrete verb-based name
- Write docstrings as user-facing tool descriptions
- Keep parameters explicit and typed
- Return structured JSON-safe data where possible
- Validate unsafe inputs early
- Prefer read-only behavior by default for first versions
Good tool examples:
get_customersearch_ticketsdescribe_tablesummarize_text_file
Weak tool examples:
runprocessdo_thing
4. Add Resources and Prompts Only When They Help
Add @mcp.resource when the client benefits from fetching stable read-only content such as schemas, policy docs, or generated reports.
Add @mcp.prompt when the server should provide a reusable prompt template for a known workflow.
Do not turn every document into a prompt. Prefer:
- tools for actions
- resources for data/document retrieval
- prompts for reusable LLM instructions
5. Test the Server Before Integrating It Anywhere
Use the FastMCP CLI for local validation:
fastmcp inspect acme_server.py:mcp
fastmcp list acme_server.py --json
fastmcp call acme_server.py search_resources query=router limit=5 --json
For fast iterative debugging, run the server locally:
fastmcp run acme_server.py:mcp
To test HTTP transport locally:
fastmcp run acme_server.py:mcp --transport http --host 127.0.0.1 --port 8000
fastmcp list http://127.0.0.1:8000/mcp --json
fastmcp call http://127.0.0.1:8000/mcp search_resources query=router --json
Always run at least one real fastmcp call against each new tool before claiming the server works.
6. Install into a Client When Local Validation Passes
FastMCP can register the server with supported MCP clients:
fastmcp install claude-code acme_server.py
fastmcp install claude-desktop acme_server.py
fastmcp install cursor acme_server.py -e .
Use fastmcp discover to inspect named MCP servers already configured on the machine.
When the goal is Hermes
अक्सर पूछे जाने वाले सवाल
क्या-क्या इंस्टॉल होना चाहिए?
fastmcp Python पैकेज, जिसे pip से इंस्टॉल किया जाता है, और API टेम्पलेट के लिए httpx।
native-mcp कब इस्तेमाल करें?
स्किल कहती है कि जब सर्वर पहले से मौजूद हो और उसे बस Hermes से जोड़ना हो, तब native-mcp इस्तेमाल करें।
क्या सर्वर HTTP पर चल सकता है?
हाँ। स्किल बताती है कि FastMCP सर्वर रिपो को HTTP पर तैनात करने के लिए कैसे तैयार करें।
जानकारी
लोकप्रियता
- GitHub स्टार
- 260k
- रैंकिंग में स्थान
- #503
- लाइसेंस
- MIT
- अपडेट की गई
- 2/11/2026
कमेंट
- …
इस repository की और skills
agent-merge-conflict-arbiter
260kदो एजेंट्स की branches के बीच git merge conflict को एक निष्पक्ष तीसरे पक्ष के रूप में सुलझाती है और रिपॉज़िटरी के लिए एक merged नतीजा बनाती है।
antigravity-cli
260kAntigravity कमांड-लाइन टूल को इंस्टॉल करने, अपडेट करने और उसकी दिक्कतें सुलझाने में मार्गदर्शन देती है, जिसमें प्लगइन, साइन-इन और sandbox शामिल हैं।
blackbox
260kआपके एजेंट को कोडिंग काम Blackbox AI कमांड-लाइन टूल को सौंपने देती है, जो कई AI मॉडल चलाकर सबसे अच्छा नतीजा चुनता है।
dynamic-workflow
260kआपके एजेंट को बड़े बैच के एक जैसे कामों को सेव की गई स्क्रिप्ट के रूप में चलाना सिखाती है, ताकि मुख्य बातचीत में केवल जांचे गए नतीजे लौटें।
मिलती-जुलती skills
mcporter
394kयह आपके एजेंट को HTTP या stdio पर MCP सर्वर और उनके टूल सूचीबद्ध करने, चलाने और जांचने देती है, और उनकी साइन-इन सेटिंग्स प्रबंधित करती है।
chatgpt-app-builder
144kआपके एजेंट को mcp-use फ़्रेमवर्क और OpenAI Apps SDK से इंटरैक्टिव विजेट वाले ChatGPT ऐप बनाने में मदद करती है।
mcp-apps-builder
144kआपके एजेंट को mcp-use फ़्रेमवर्क की सर्वोत्तम प्रथाओं के अनुसार tools, resources, prompts और विजेट वाले MCP सर्वर बनाने और सुधारने में मदद करती है।