MCP Server Example
This server provides note management, basic arithmetic, and AI-driven content generation.
Tools:
add(a, b): Returns the sum of two numbers.multiply(a, b): Returns the product of two numbers.save_note(name, content): Saves a note with the given name and content.delete_note(name): Deletes a note by name.
Resources:
notes://list: Lists all saved notes.notes://{name}: Reads the content of a specific note.
Prompts:
summarize_notes: Summarizes all saved notes.brainstorm(topic): Brainstorms ideas on a specified topic.
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 Example Save a note called 'ideas' with 'Build a custom MCP server'"
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 Example
A simple MCP (Model Context Protocol) server for learning the core primitives: Tools, Resources, and Prompts.
Setup
Prerequisites
Python 3.10+
Install
uv syncRelated MCP server: MCP AI Chat LangChain
Test
Option 1 — MCP Inspector (recommended)
uv run mcp dev server.pyOpens a browser UI at http://localhost:6274. From there you can:
Tools tab: call
save_note,delete_notewith custom inputsResources tab: read
notes://listornotes://{name}Prompts tab: run
summarize_notesorbrainstormwith arguments
Option 2 — CLI with mcp client
List all available tools:
echo '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' | uv run python server.pyConnect to Claude Code (CLI)
Add the server to your Claude Code session:
claude mcp add learning-mcp -- uv run --directory /Users/binod/projects/mcp-example python server.pyVerify it's connected:
claude mcp listOnce added, Claude Code can call your tools directly in the chat — just ask it to, e.g. "save a note called 'ideas'".
Connect to Claude Desktop
Add this to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"learning-mcp": {
"command": "uv",
"args": [
"run",
"--directory", "/Users/binod/projects/mcp-example",
"python", "server.py"
]
}
}
}Then restart Claude Desktop.
Use programmatically (Python)
Use the mcp library to call tools, read resources, and fetch prompts from your own code:
from mcp import ClientSession
from mcp.client.stdio import stdio_client, StdioServerParameters
import asyncio
async def main():
server = StdioServerParameters(
command="uv", args=["run", "python", "server.py"]
)
async with stdio_client(server) as (read, write):
async with ClientSession(read, write) as session:
await session.initialize()
# Read a resource
notes = await session.read_resource("notes://list")
print(notes)
# Get a prompt
prompt = await session.get_prompt("brainstorm", {"topic": "side projects"})
print(prompt)
asyncio.run(main())To let Claude (via Anthropic API) call your tools, add anthropic[mcp] to your dependencies and convert the tools:
from anthropic.lib.tools.mcp import async_mcp_tool
import anthropic
client = anthropic.AsyncAnthropic()
tools = [async_mcp_tool(t, session) for t in (await session.list_tools()).tools]
runner = client.beta.messages.tool_runner(
model="claude-opus-4-6",
max_tokens=1024,
messages=[{"role": "user", "content": "Save a note called ideas"}],
tools=tools,
)
async for message in runner:
for block in message.content:
if hasattr(block, "text"):
print(block.text)What's inside
File | Description |
| MCP server with tools, resources, and prompts |
| Project dependencies |
Tools (Claude can call these)
Tool | Description |
| Save a note |
| Delete a note |
Resources (Claude can read these)
URI | Description |
| List all saved notes |
| Read a specific note |
Prompts (reusable templates)
Prompt | Description |
| Summarize all saved notes |
| Brainstorm ideas on a topic |
Available Tools
4 toolsaddA
Add two numbers.
Inputs: a (required), b (required). Returns: result
delete_noteC
Delete a note by name.
Inputs: name (required). Returns: result
multiplyA
Multiply two numbers.
Inputs: a (required), b (required). Returns: result
save_noteC
Save a note with a given name.
Inputs: name (required), content (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 4 tools
The tools fall into two unrelated domains (arithmetic and note management) with no overlap within each domain, but the set as a whole is confusing because add/multiply and delete_note/save_note serve completely different purposes. An agent might struggle to understand why these tools are grouped together, though individual tools are distinct.
Naming is inconsistent across the set: add and multiply use simple verbs without objects, while delete_note and save_note follow a verb_noun pattern. This mixed convention lacks a predictable pattern, making the tool set harder to navigate.
With 4 tools, the count is reasonable for a small server, but it feels thin and poorly scoped because it covers two unrelated domains. For either arithmetic or note management alone, 4 tools would be appropriate, but combined, it suggests an incomplete or mismatched purpose.
For arithmetic, basic operations like subtraction and division are missing, leaving gaps. For note management, there's no way to list or retrieve notes, creating dead ends. The server lacks a clear domain, making completeness hard to assess, but obvious gaps exist in both inferred areas.
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
The Mercado Pago MCP Server implements the Model Context Protocol to provide AI agents and LLMs with access to Mercado Pago's APIs and tools within compatible development environments. It acts as an intermediary that translates Mercado Pago resources into executable functions (tools) that AI applications can invoke to perform actions and automate flows. The server simplifies integration, enables using documentation to implement or improve code, and optimizes operations through natural language interactions without manual implementations.
A Model Context Protocol server for Wix AI tools
Model Context Protocol server for the Apideck Unified API. Connect any MCP-compatible agent framework to 100+ accounting systems, HRIS platforms, file storage providers, and more through one integration. More information https://www.apideck.com/mcp-server
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA sample implementation of Model Context Protocol server demonstrating core functionality with simple arithmetic tools and greeting resources.-
- FlicenseNot gradedqualityDmaintenanceA basic Model Context Protocol server implementation that demonstrates core functionality including tools and resources for AI chat applications.-
- FlicenseNot gradedqualityDmaintenanceA demonstration implementation of a Model Context Protocol server that provides simple mathematical tools (add, subtract) and personalized greeting resources.-
- AlicenseNot gradedqualityNot gradedmaintenanceA demonstration MCP server that provides calculator tools for arithmetic operations, personalized greeting resources, and code review prompt templates. Enables users to perform basic math calculations, generate dynamic greetings, and access reusable code review templates through the Model Context Protocol.MIT