DM

dongrelaxman/mcp

Developer tools

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기

0 stars 0 forks 품질 60 트렌드 4

Create MCP servers locally and for Remote also.

개요

A simple Model Context Protocol project built with FastMCP. The client is a Streamlit chat UI powered by GPT-4o-mini. It talks to an MCP server over HTTP and uses its tools to answer questions. The compose file starts the server first, waits for it to be healthy, then starts the Streamlit client. For a detailed breakdown of how each piece works, see docs/architecture.md. - — Rolls n six-sided dice and returns the results - — Adds two numbers Server starts at http://localhost:8000/mcp. Set URL to http://localhost:8000/mcp and click .

README

MCP Demo

A simple Model Context Protocol project built with FastMCP.

The client is a Streamlit chat UI powered by GPT-4o-mini. It talks to an MCP server over HTTP and uses its tools to answer questions.

mcp-test/
├── server/             # FastMCP server exposing tools over streamable-http
│   └── main.py
├── client/
│   ├── main.py         # MCP client + OpenAI tool-calling logic
│   └── streamlit_app.py  # Streamlit chat UI
└── docker-compose.yaml


Quickstart (Docker)

cp .env.example .env   # add your OPENAI_API_KEY
docker compose up --build

Open http://localhost:8501 in your browser.

The compose file starts the server first, waits for it to be healthy, then starts the Streamlit client.

Environment variables

Variable Description
OPENAI_API_KEY Required. Used by the client to call GPT-4o-mini.
SERVER_URL MCP server URL. Defaults to http://localhost:8000/mcp.

Architecture

 Streamlit
     │
     ▼
  Client (LLM)
     │                   ┌─────────────┐
     ├── calls tools ──► │   Server    │
     │                   └──────┬──────┘
     │◄── tool results ─────────┘
     │
     ▼
  Client (LLM)
     │
     ▼
 Streamlit

For a detailed breakdown of how each piece works, see docs/architecture.md.


Server tools

  • rool_dice(n_dice) — Rolls n six-sided dice and returns the results
  • add_number(a, b) — Adds two numbers

Running locally (without Docker)

Server

cd server
pip install -r requirements.txt
python main.py

Server starts at http://localhost:8000/mcp.

Client

cd client
pip install -r requirements.txt
streamlit run streamlit_app.py

UI starts at http://localhost:8501.

Test with MCP Inspector

npx @modelcontextprotocol/inspector

Set URL to http://localhost:8000/mcp and click Connect.

Claude Desktop config

{
  "mcpServers": {
    "demo": {
      "type": "streamable-http",
      "url": "http://localhost:8000/mcp"
    }
  }
}
GitHub에서 전체 README 보기

설치

npx @modelcontextprotocol/inspector
MCP 초보자라면? mcpskill.org 가이드부터 시작하세요 →

설정

{ "mcpServers": { "demo": { "type": "streamable-http", "url": "http://localhost:8000/mcp" } } }