Skip to main content
Glama
Demo FastMCP Server

Demo FastMCP Server

by Jungwoo-Ryu

Demo FastMCP Server

로컬에서 FastMCP 서버 구조(tools / resources / prompts / lifespan)를 실험하기 위한 더미 프로젝트입니다.

툴만 추가하려면 → docs/ADD_TOOL.md

구조

src/demo_mcp/
├── server.py          # FastMCP 인스턴스 + lifespan + 등록 진입점
├── config.py          # 설정/시드 데이터
├── tools/             # @mcp.tool
│   ├── echo.py
│   ├── calculator.py
│   └── notes.py       # lifespan context 예시
├── resources/         # @mcp.resource
│   ├── config.py
│   └── notes.py
└── prompts/           # @mcp.prompt
    └── assistant.py
tests/
└── test_server.py     # Client(mcp) 인메모리 테스트

Related MCP server: mcp-server-demo

설치

uv sync --extra dev

테스트

uv run pytest -q

인메모리 Client(mcp)로 transport 없이 tools/resources/prompts를 검증합니다.

서버 실행

HTTP (기본):

uv run demo-mcp

서버 URL: http://127.0.0.1:8000/mcp

환경변수로 바꿀 수 있습니다.

변수

기본값

설명

DEMO_MCP_TRANSPORT

http

http 또는 stdio

DEMO_MCP_HOST

127.0.0.1

바인드 호스트

DEMO_MCP_PORT

8000

포트

DEMO_MCP_PATH

/mcp

MCP 엔드포인트 경로

stdio:

DEMO_MCP_TRANSPORT=stdio uv run demo-mcp

Cursor MCP 연결 예시

HTTP (서버를 먼저 uv run demo-mcp로 실행한 뒤):

{
  "mcpServers": {
    "demo-mcp": {
      "url": "http://127.0.0.1:8000/mcp"
    }
  }
}

이미 .cursor/mcp.json에 위 설정이 들어 있습니다.

포함된 더미 기능

종류

이름

설명

tool

echo, greet

단순 문자열

tool

add, calculate

사칙연산

tool

save_note, get_note, list_notes

lifespan store

resource

config://app

서비스 메타

resource

notes://{key}

시드 노트

prompt

summarize, code_review

프롬프트 템플릿

mcp

Available Tools

7 tools
addA

Add two numbers.

Inputs: a (required), b (required). Returns: result

calculateC

Run a basic arithmetic operation.

Inputs: a (required), b (required), op. Returns: result

echoA

Echo the given message unchanged.

Inputs: message (required). Returns: result

get_noteA

Read a note from the process-local store.

Inputs: key (required). Returns: result

greetB

Return a simple greeting string.

Inputs: name. Returns: result

list_notesA

List all notes currently held in lifespan store.

Inputs: no named parameters. Returns: object

save_noteA

Save a note into the process-local store (lifespan context).

Inputs: key (required), value (required). Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 7 tools

    Disambiguation3/5

    The note tools are clearly distinct, but 'add' and 'calculate' overlap since calculate can perform addition. 'echo' and 'greet' are both simple string-returning tools, though their purposes are slightly different.

    Naming Consistency3/5

    Tool names mix single-word verbs (add, calculate, echo, greet) with verb_noun patterns (save_note, get_note, list_notes). This is readable but lacks a consistent convention across the set.

    Tool Count4/5

    Seven tools is a reasonable count for a demo server, though a couple (echo, greet) are trivial and add little functional value. Still well within the typical 3-15 range.

    Completeness3/5

    The note tools cover save, read, and list but lack update and delete. The arithmetic tools are minimal (add and calculate). There are minor gaps, but for a demo server the coverage is acceptable.

    Related MCP Connectors

    Related MCP Servers