Skip to main content
Glama
hussain-alsaibai

tiny-mcp-server

tiny-mcp-server

Python으로 Model Context Protocol(MCP) 서버를 구축하는 가장 빠르고 가장 작은 방법. 제로 의존성. MIT.

tiny-mcp-serverModel Context Protocol 서버를 구축하기 위한 단일 파일 Python 프레임워크입니다. 외부 의존성이 없고, 보일러플레이트도 없습니다. 함수에 @tool 데코레이터를 붙이기만 하면 MCP 서버를 배포할 수 있습니다.

기능

  • 🪶 단일 파일, 제로 의존성 — 순수 Python 표준 라이브러리, 어떤 프로젝트에든 넣기만 하면 됩니다

  • 🪄 @tool 데코레이터 — 한 줄로 어떤 함수든 MCP 도구로 만들어 줍니다

  • 🚀 다중 전송 방식 — 데스크톱 MCP 클라이언트용 stdio와 웹/원격용 sse

  • 자동 JSON Schema 생성 — 타입 힌트와 독스트링이 도구 스키마가 됩니다

  • �️ 내장 로깅 및 오류 처리 — 잘못된 페이로드에서도 절대 크래시하지 않습니다

  • �️ MIT 라이선스 — 어디서든 사용 가능

Related MCP server: MCP Starter

설치

가장 쉬운 방법을 선택하세요:

# Option 1 — pip (when published)
pip install tiny-mcp-server

# Option 2 — curl a single file and import it
curl -O https://raw.githubusercontent.com/hussain-alsaibai/tiny-mcp-server/main/tiny_mcp_server.py

# Option 3 — vendor it
cp tiny_mcp_server.py your_project/

빠른 시작

두 개의 도구를 가진 완전한 MCP 서버입니다 — 20줄 미만:

from tiny_mcp_server import Server, tool

app = Server("hello-world")

@app.tool
def add(a: int, b: int) -> int:
    """Add two numbers together."""
    return a + b

@app.tool
def greet(name: str = "World") -> str:
    """Greet someone by name."""
    return f"Hello, {name}!"

if __name__ == "__main__":
    app.run("stdio")  # or "sse" for HTTP transport

add 도구의 자동 생성 JSON Schema:

{
  "name": "add",
  "description": "Add two numbers together.",
  "inputSchema": {
    "type": "object",
    "properties": {
      "a": {"type": "integer"},
      "b": {"type": "integer"}
    },
    "required": ["a", "b"]
  }
}

전송 방식

stdio (기본값 — Claude Desktop, Cursor 등)

app.run("stdio")

서버는 stdin에서 JSON-RPC 메시지를 읽고 stdout으로 응답을 작성합니다. 이는 모든 데스크톱 MCP 클라이언트에서 사용하는 전송 방식입니다.

SSE (HTTP — 웹 클라이언트용)

app.run("sse", host="127.0.0.1", port=8000)

/sse에 Server-Sent Events 엔드포인트를 노출하고 /messages에 POST 엔드포인트를 노출합니다. MCP 서버를 로컬 마이크로서비스로 실행하기에 좋습니다.

API 참조

Server(name: str)

app = Server("my-server")

@app.tool

@app.tool(name="optional-name", description="optional-desc")
def my_tool(arg: str, count: int = 1) -> str:
    """Tool description (used as fallback if description not provided)."""
    return arg * count
  • name — 기본값은 함수 이름

  • description — 기본값은 함수의 독스트링

  • 인자는 시그니처에서 추론되고, 타입은 주석(annotation)에서 추론됩니다

  • 기본값은 스키마에서 선택 사항이 됩니다

app.run(transport: str, **kwargs)

  • "stdio" — 추가 인자 없음

  • "sse"host (기본값 127.0.0.1), port (기본값 8000)

예제

실행 가능한 데모는 examples/hello_world.py를 참조하세요.

라이선스

MIT © hussain-alsaibai

A
license - permissive license
-
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    D
    quality
    D
    maintenance
    A foundation for building custom local Model Context Protocol (MCP) servers that provide tools accessible to AI assistants like Cursor or Claude Desktop.
    1
    37
    MIT
  • A
    license
    -
    quality
    D
    maintenance
    A universal framework for creating and deploying custom Model Context Protocol (MCP) tool servers with decorator-based tool registration, supporting multiple transports and automatic JSON schema generation for AI assistants.
    1
    MIT

View all related MCP servers

Related MCP Connectors

  • A Model Context Protocol server for Wix AI tools

  • A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…

  • AI Reasoning Cache & Consensus Layer with 11 MCP tools via Streamable HTTP.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/hussain-alsaibai/tiny-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server