본문으로 건너뛰기
Skillpedia
커넥터 (MCP)260k · #503

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가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/NousResearch/hermes-agent/blob/main/optional-skills/mcp/fastmcp/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

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 support
  • templates/database_server.py - read-only SQLite query server
  • templates/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_customer
  • search_tickets
  • describe_table
  • summarize_text_file

Weak tool examples:

  • run
  • process
  • do_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 서버 저장소를 준비하는 방법을 다룹니다.

상세 정보

작성자의 원본 설명

Build, test, and deploy Python MCP servers.

repo: NousResearch/hermes-agent

인기도

GitHub 스타
260k
순위
#503
라이선스
MIT
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬