mcp-server
This server provides an MCP interface with tools, resources, and prompt templates for learning and testing MCP integrations.
Health check: Call
healthto verify connectivity and get server metadata.Arithmetic: Use
addandmultiplyfor integer math.Echo: Use
echoto return text unchanged.User profiles: Fetch structured profiles with
get_user_profile; unknown IDs return a clean tool error.Intentional failure: Use
failto see how tool errors reach clients.Resources: Access app metadata, static config, and profile data via MCP/
dataURIs.Prompts: Use reusable templates like
profile_review,analyze_profiles, andserver_overview.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-server run a health check"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Server
An SDK-first MCP (Model Context Protocol) learning and production-readiness project built in Python with the official MCP SDK.
The goal is to understand MCP deeply while building a practical MCP server that can serve as a real integration-testing target for other AI/agent codebases.
Status
Phase 6 — LLM / Agent Integration (current): a provider-agnostic agent (
examples/agent.py) that discovers tools, selects them, invokes them, and feeds results back (demoed with a deterministic mock LLM).Phase 5 — MCP Client: an example client (
examples/mcp_client.py) that connects over stdio and exercises the full lifecycle (tools, resources, prompts, failures).Phase 4 — Prompts: reusable prompt templates (
profile_review,analyze_profiles,server_overview).Phase 3 — Resources: resources exposed by URI — application metadata (
mcp://server/info), static config (mcp://server/config), and profile data (data://profiles,data://profile/{user_id}).Phase 2 — Tools: deterministic MCP tools (
add,multiply,echo,get_user_profile,fail) alongside the Phase 1healthtool.Phase 1 — Minimal MCP Server: a small, runnable server using the
MCPServerabstraction over stdio, with a minimalhealthcapability.
See docs/roadmap.md for the full plan,
docs/mcp-basics.md for MCP concepts,
docs/tools.md for tools, docs/resources.md
for resources, docs/prompts.md for prompts,
docs/client.md for the client lifecycle, and
docs/agent.md for agent integration.
Related MCP server: hello-mcp
Requirements
Python 3.11+
Setup
uv syncThis creates a virtual environment and installs the MCP SDK and dev tools (including pytest).
Running the server
uv run mcp-serverThe server starts over stdio — the appropriate transport for local development. It stays alive until the connecting client closes the stream. To interact with it you need an MCP client (see the MCP basics doc).
Running the example client
uv run python examples/mcp_client.pyThe client launches the server over stdio and demonstrates the full lifecycle:
initializing, listing/calling tools, listing/reading resources, listing/getting
prompts, and handling failures. See docs/client.md.
Running the example agent
uv run python examples/agent.pyThe agent discovers the server's tools, selects them for a user request, invokes
them, and feeds the results back — running several tool calls in one session. It
is provider-agnostic and ships a deterministic MockLLM, so it runs with no API
key. See docs/agent.md.
Running the tests
uv run pytestProject layout
src/mcp_server/ # MCP server implementation
server.py # server construction, health tool, stdio entry point
tools.py # deterministic tools (business logic + registration)
resources.py # resources exposed by URI (data + registration)
prompts.py # reusable prompt templates (messages + registration)
examples/
mcp_client.py # example client driving the full lifecycle over stdio
agent.py # example agent (discover/select/call tools, mock LLM)
tests/
unit/ # business-logic unit tests
integration/ # end-to-end tests (real MCP client over stdio)
docs/ # roadmap and concept documentationHow a client talks to this server
Application / Host
↓
MCP Client
↓
MCP Protocol
↓
MCP Server
↓
Application logicSee docs/mcp-basics.md for a deeper explanation.
Available Tools
6 toolsaddA
Add two integers.
Inputs: a (required), b (required). Returns: result
echoA
Echo the input text back unchanged.
Inputs: text (required). Returns: result
failA
Intentionally fail to demonstrate how tool errors reach the client.
Raises a ToolError so the client receives a clean is_error result
carrying this message, instead of an unexpected server crash.
Inputs: no named parameters. Returns: result
get_user_profileA
Return a structured user profile by id.
Raises a ToolError for an unknown id — an anticipated failure the
client can read, rather than a crash.
Inputs: user_id (required). Returns: object
healthA
Return basic server health and metadata.
A minimal, deterministic capability used to verify that a client can connect, initialize, and invoke the server successfully.
Inputs: no named parameters. Returns: object
multiplyA
Multiply two integers.
Inputs: a (required), b (required). Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool has a clearly distinct purpose: health checks connectivity, add and multiply perform arithmetic, echo returns text, get_user_profile fetches a profile, and fail deliberately raises an error. There is no meaningful overlap between any pair of tools.
Most tools use short, lowercase names like add, multiply, echo, and fail, but health is a noun rather than an action and get_user_profile uses a verb_noun pattern. The naming is readable overall but mixes conventions.
Six tools is a reasonable size for a small server, and each tool contributes something distinct. However, the set feels like a grab bag of unrelated utilities rather than a tightly scoped collection.
There is no coherent domain that the tool set fully covers: the math tools only support add and multiply, and the user profile surface has only a single get operation with no list, create, update, or delete. This makes the overall surface feel incomplete and ad hoc.
Maintenance
Related MCP Connectors
Hosted MCP server for live public-data APIs and Skills for AI agents.
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
An MCP server for Arcjet - the runtime security platform that ships with your AI code.
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA minimal demonstration server showcasing MCP protocol capabilities including tools, resources, and prompts with basic examples like hello world functionality.MIT
- FlicenseNot gradedqualityDmaintenanceA minimal learning-focused MCP server that demonstrates core primitives like tools and resources through simple greeting functions. It provides a foundational example for connecting AI models to external data using both Streamable HTTP and stdio transports.-
- AlicenseAqualityBmaintenanceA minimal MCP server that provides health/status checks and multilingual greetings via the server_info and greet tools.2165 PyPIMIT
- FlicenseNot gradedqualityDmaintenanceA minimal MCP server over Streamable HTTP demonstrating the MCP protocol with tools for health checks, echo, and text reversal.-