mcp_aj
Click on "Install 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_ajAdd 15 and 27, then read test.txt and tell me its info."
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.
Python MCP 2.x Server: Hands-on Example
This project is a small, complete Model Context Protocol (MCP) server and client written for Python 3.13 and the installed mcp==2.1.1 SDK. It deliberately uses the MCP 2.x MCPServer API, not the old FastMCP API.
What MCP is
MCP is an open protocol for connecting an AI application to external capabilities in a consistent way. Instead of an application inventing a separate integration format for every database, API, or local utility, MCP gives it standard operations to discover capabilities and invoke them.
Related MCP server: Simple Calculator MCP Server
MCP architecture
MCP client -- JSON-RPC over stdio --> MCP server --> registered Python tool/resource/prompt
^ | |
+----------- structured result --------+-------------------------+This example uses the stdio transport. The client starts server.py as a subprocess, writes MCP JSON-RPC messages to its standard input, and receives MCP responses from standard output. Standard output is therefore reserved for the protocol; diagnostics belong on standard error.
Client versus server
An MCP server exposes capabilities and implements their behavior. Here, server.py declares five tools, a resource, and a prompt.
An MCP client connects to a server, discovers those capabilities, and requests work. Here, client.py starts the server through the SDK's stdio transport, initializes an ClientSession, lists tools, and calls three of them.
Tools, resources, and prompts
MCP feature | Purpose | This project |
Tool | An action with input that returns a result. |
|
Resource | Readable server-provided context addressed by a URI. |
|
Prompt | A reusable template that returns chat messages. |
|
Project structure
mcp_python_server/
├── server.py # MCP 2.x server, five tools, one resource, and one prompt
├── client.py # stdio MCP client that exercises the math tools
├── requirements.txt # pinned, verified MCP SDK dependency
├── README.md # setup, architecture, and troubleshooting guide
└── test.txt # a safe example file for the file-reading tools and promptInstallation on macOS
From the repository root:
cd mcp_python_server
python3.13 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -r requirements.txtThe requirement is pinned to mcp==2.1.1, the MCP 2.x SDK version verified for this project. Its transitive dependencies are installed automatically by pip.
Run the server
Activate the environment, then run:
python server.pyThe server waits for MCP JSON-RPC messages on standard input. It does not print a friendly interactive menu, because standard output is the MCP protocol channel. Usually another MCP client, such as client.py, launches it for you.
Run the client
With the environment activated:
python client.pyThe client asks for two integers and a comma-separated list of numbers, then passes your values to the MCP tools. For example, enter 10, 20, and 10, 20, 30, 40, 50; the output includes:
Add result: 30
Multiply result: 200
Average result: 30.0The first line also lists the discovered server tools.
What happens in an MCP request
For add_numbers(10, 20), the request flow is:
client.pycreatesStdioServerParametersfor the same Python interpreter andserver.py, then opensstdio_client(...).ClientSession.initialize()completes the MCP handshake;list_tools()asks the server which tools it exposes.session.call_tool("add_numbers", {"a": 10, "b": 20})sends an MCPtools/callJSON-RPC request over stdio.The MCP 2.x
MCPServerroutes that request to the function registered with@server.tool().add_numbersreceives two validated Python integers and returns10 + 20, which is30.The SDK serializes that result into an MCP
CallToolResult; the client receives it and printsAdd result: 30.
The multiply and average calls follow the same path. The client really invokes a separate server subprocess through MCP; it does not import and call the tool functions directly.
File tool safety
read_text_file and get_file_info resolve a requested path and require it to remain inside the directory containing server.py. They reject blank names, null bytes, missing files, directories, traversal such as ../secret.txt, and symlinks that resolve outside the project. Text reads are UTF-8 only, with clear errors for invalid text. test.txt is a safe file to use:
# Via an MCP client session:
await session.call_tool("read_text_file", {"filename": "test.txt"})
await session.call_tool("get_file_info", {"filename": "test.txt"})Common errors
Problem | Likely cause and fix |
| Activate the project virtual environment and run |
| Use the virtual environment above and reinstall from |
Server appears to do nothing | This is normal when started directly: it is waiting for MCP messages on standard input. Run |
| Supply a relative filename such as |
| Use |
Client cannot start the server | Confirm |
SDK APIs used
This project was verified against the installed MCP 2.1.1 package. The key APIs are:
from mcp.server import MCPServer
from mcp import ClientSession
from mcp.client.stdio import StdioServerParameters, stdio_clientserver.py uses @server.tool(), @server.resource(), @server.prompt(), and server.run(transport="stdio"). It does not import or use mcp.server.fastmcp.FastMCP.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
OCR, transcription, file extraction, and image generation for AI agents via MCP.
Your org's AI agents, tasks, runs, search, and brain files as MCP tools and resources.
Project management MCP for AI agents with safe task reads and writes.
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI applications to perform basic mathematical operations like addition and subtraction through MCP tools. Also provides REST API endpoints for the same operations.MIT
- AlicenseNot gradedqualityDmaintenanceEnables basic arithmetic operations (add, subtract, multiply, divide, modulo) via natural language, with a FastMCP-based server and client for exploring MCP tool calling.MIT
- AlicenseNot gradedqualityDmaintenanceProvides a comprehensive set of mathematical functions as MCP tools, enabling language models to perform calculations including arithmetic, trigonometry, logarithms, and more.231MIT
- FlicenseNot gradedqualityCmaintenanceAn MCP server providing calculator and file system tools, enabling AI agents to perform mathematical calculations and file operations.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/harshsareen03/mcp_aj'
If you have feedback or need assistance with the MCP directory API, please join our Discord server