The README shows integration with .env files for environment variable configuration.
The README mentions numpy as an optional dependency that can be specified for deployment and development.
The README shows configuration with an OPENAI_API_KEY in the .env file, suggesting integration capabilities with OpenAI's services.
The README mentions pandas as an optional dependency that can be specified for deployment and development.
The README includes an example 'SQLite Explorer' that demonstrates database integration with SQLite, allowing users to query SQLite databases and retrieve schema information.
MCP Python SDK
Usage
to run the client
to run the server
Data Prep
Insert Node:
Insert Relationship
Insert properties
Insert Complex Structure
other things - boiler plate - no clue - ignore for now.
Python implementation of the Model Context Protocol (MCP)
Table of Contents
- Overview
- Installation
- Quickstart
- What is MCP?
- Core Concepts
- Running Your Server
- Examples
- Advanced Usage
- Documentation
- Contributing
- License
Overview
The Model Context Protocol allows applications to provide context for LLMs in a standardized way, separating the concerns of providing context from the actual LLM interaction. This Python SDK implements the full MCP specification, making it easy to:
- Build MCP clients that can connect to any MCP server
- Create MCP servers that expose resources, prompts and tools
- Use standard transports like stdio and SSE
- Handle all MCP protocol messages and lifecycle events
Installation
We recommend using uv to manage your Python projects:
Alternatively:
Quickstart
Let's create a simple MCP server that exposes a calculator tool and some data:
You can install this server in Claude Desktop and interact with it right away by running:
Alternatively, you can test it with the MCP Inspector:
What is MCP?
The Model Context Protocol (MCP) lets you build servers that expose data and functionality to LLM applications in a secure, standardized way. Think of it like a web API, but specifically designed for LLM interactions. MCP servers can:
- Expose data through Resources (think of these sort of like GET endpoints; they are used to load information into the LLM's context)
- Provide functionality through Tools (sort of like POST endpoints; they are used to execute code or otherwise produce a side effect)
- Define interaction patterns through Prompts (reusable templates for LLM interactions)
- And more!
Core Concepts
Server
The FastMCP server is your core interface to the MCP protocol. It handles connection management, protocol compliance, and message routing:
Resources
Resources are how you expose data to LLMs. They're similar to GET endpoints in a REST API - they provide data but shouldn't perform significant computation or have side effects:
Tools
Tools let LLMs take actions through your server. Unlike resources, tools are expected to perform computation and have side effects:
Prompts
Prompts are reusable templates that help LLMs interact with your server effectively:
Images
FastMCP provides an Image
class that automatically handles image data:
Context
The Context object gives your tools and resources access to MCP capabilities:
Running Your Server
Development Mode
The fastest way to test and debug your server is with the MCP Inspector:
Claude Desktop Integration
Once your server is ready, install it in Claude Desktop:
Direct Execution
For advanced scenarios like custom deployments:
Run it with:
Examples
Echo Server
A simple server demonstrating resources, tools, and prompts:
SQLite Explorer
A more complex example showing database integration:
Advanced Usage
Low-Level Server
For more control, you can use the low-level server implementation directly. This gives you full access to the protocol and allows you to customize every aspect of your server, including lifecycle management through the lifespan API:
The lifespan API provides:
- A way to initialize resources when the server starts and clean them up when it stops
- Access to initialized resources through the request context in handlers
- Type-safe context passing between lifespan and request handlers
Writing MCP Clients
The SDK provides a high-level client interface for connecting to MCP servers:
MCP Primitives
The MCP protocol defines three core primitives that servers can implement:
Primitive | Control | Description | Example Use |
---|---|---|---|
Prompts | User-controlled | Interactive templates invoked by user choice | Slash commands, menu options |
Resources | Application-controlled | Contextual data managed by the client application | File contents, API responses |
Tools | Model-controlled | Functions exposed to the LLM to take actions | API calls, data updates |
Server Capabilities
MCP servers declare capabilities during initialization:
Capability | Feature Flag | Description |
---|---|---|
prompts | listChanged | Prompt template management |
resources | subscribe listChanged | Resource exposure and updates |
tools | listChanged | Tool discovery and execution |
logging | - | Server logging configuration |
completion | - | Argument completion suggestions |
Documentation
- Model Context Protocol documentation
- Model Context Protocol specification
- Officially supported servers
Contributing
We are passionate about supporting contributors of all levels of experience and would love to see you get involved in the project. See the contributing guide to get started.
License
This project is licensed under the MIT License - see the LICENSE file for details.
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
An MCP server that enables graph database interactions with Neo4j, allowing users to access and manipulate graph data through natural language commands.
Related Resources
Related MCP Servers
- AsecurityAlicenseAqualityThis server enables interaction between Neo4j databases and Claude Desktop, allowing users to execute Cypher queries, create nodes, and establish relationships in the database.Last updated -37224TypeScriptMIT License
- -securityFlicense-qualityA fork of the Neo4j Model Context Protocol server that enables interaction with Neo4j knowledge graphs through environment variable configuration and improved options for remote connections.Last updated -1TypeScript
- -securityAlicense-qualityAn MCP server that enables users to create and manage MongoDB Atlas clusters, users, and network access through natural language commands.Last updated -7410JavaScriptMIT License
- -securityAlicense-qualityEnhanced knowledge graph memory server for AI assistants that uses Neo4j as the backend storage engine, enabling powerful graph queries and efficient storage of user interaction information with full MCP protocol compatibility.Last updated -TypeScriptMIT License