This repository contains a simple implementation of the MCP server that uses the Standard Input/Output Transport.
- Create a virtual environment (recommended) and install dependencies:
python3 -m venv .venv
source .venv/bin/activate
OR, do it at once.
python3 -m venv .venv && source .venv/bin/activate
For the Environment setup above, you can use your favourit environment manager like, Conda. 2) Install dependencies: To isntall from a requirements file:
pip install -r requirements.txt
- Start the server
stdio
transport:
uv run main.py
- Inspector Test your MCP with the MCP Inpector:
npx @modelcontextprotocol/inspector \
uv \
--directory path/to/server \
run \
package-name \
args...
- Link with an MCP client.
Of course this assumes you might or might not be having other servers already, if you have others then Add the cortexhub_mcp_server
as additional key to the mcpServers
object.
Cursor config (example):
.cursor/mcp.json
{
"mcpServers": {
"cortexhub_mcp_server_stdio": {
"command": "uv",
"args": [
"--directory",
"/absolute/path/to/mcp-demo-stdio",
"run",
"main.py"
]
},
"cortexhub_mcp_server_http": {
"url": "http://127.0.0.1:8000/mcp"
}
}
}
Note: Replace /absolute/path/to/
with your actual project path.
- Keep resources passive: They should return data, not perform complex operations
- Use clear names: Resource names should clearly indicate what data they provide
- Document thoroughly: Include docstrings explaining what each resource contains
- Handle errors gracefully: Return helpful error messages if data can't be accessed
- Keep data fresh: For dynamic data, consider caching strategies