fastmcp
하는 일
FastMCP로 Python MCP 서버를 만들고, 로컬에서 테스트하고, AI 클라이언트에 설치하는 과정을 안내합니다. 자신의 도구를 AI 어시스턴트에 연결하려는 개발자를 위한 것입니다.
사용하는 경우
- ✓Python으로 새 MCP 서버를 만들고 싶을 때.
- ✓API, 데이터베이스, 명령줄 도구를 MCP 도구로 감싸고 싶을 때.
- ✓클라이언트에 연결하기 전에 서버를 로컬에서 테스트하고 싶을 때.
스킬 링크
https://github.com/NousResearch/hermes-agent/blob/main/optional-skills/mcp/fastmcp/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“제 어시스턴트가 읽기 전용 모드로 SQLite 판매 데이터베이스를 조회할 수 있도록 간단한 Python MCP 서버를 만들어 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 REST 래퍼, 데이터베이스 서버, 파일 처리기 같은 템플릿에서 시작해 도구를 추가하고, FastMCP 명령줄로 서버를 점검합니다. 그다음 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
자주 묻는 질문
무엇을 설치해야 하나요?
pip로 설치하는 fastmcp Python 패키지와, API 템플릿용 httpx입니다.
언제 native-mcp를 써야 하나요?
서버가 이미 있고 Hermes에 연결하기만 하면 될 때는 스킬이 native-mcp를 쓰라고 합니다.
서버를 HTTP로 실행할 수 있나요?
네. 스킬은 HTTP 배포를 위해 FastMCP 서버 저장소를 준비하는 방법을 다룹니다.
상세 정보
인기도
- GitHub 스타
- 260k
- 순위
- #503
- 라이선스
- MIT
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
agent-merge-conflict-arbiter
260k병렬로 작업한 두 에이전트 브랜치 사이의 git 병합 충돌을 중립적인 제3자로서 해결하고, 저장소에 하나의 병합 결과를 만듭니다.
antigravity-cli
260kAntigravity 명령줄 도구의 설치, 업데이트, 플러그인, 로그인, 샌드박스 문제를 해결하도록 단계별로 안내합니다.
blackbox
260k에이전트가 여러 AI 모델을 실행해 최선의 결과를 고르는 Blackbox AI 명령줄 도구에 코딩 작업을 맡기도록 돕습니다.
dynamic-workflow
260k많은 비슷한 작업을 저장된 스크립트로 실행하고, 검증된 결과만 메인 대화로 돌아오도록 에이전트에게 가르칩니다.
비슷한 스킬
mcporter
394k에이전트가 HTTP나 stdio로 MCP 서버와 그 도구를 목록화하고, 호출하고, 점검하며, 로그인 설정을 관리하도록 돕습니다.
chatgpt-app-builder
144kmcp-use 프레임워크와 OpenAI Apps SDK를 사용해 대화형 위젯이 있는 ChatGPT 앱을 만드는 것을 에이전트가 돕습니다.
mcp-apps-builder
144kmcp-use 모범 사례에 따라 도구, 리소스, 프롬프트, 위젯을 갖춘 MCP 서버를 만들고 고치도록 돕습니다.