MCP server in Python
Creating a barebones MCP server around python (plus uv), encapsulated in a nix flake
Overview
Minimal MCP in Nix is a barebones MCP (Multi-Channel Protocol) server implemented in Python, designed to work seamlessly with Nix package management.
To use this project, you can initialize it using the provided Nix flake template and run the server with the specified command in your Claude configuration.
- Simple implementation of an MCP server in Python. - Nix flake integration for easy setup and management. - Provides a stub location for demo purposes.
- Demonstrating MCP functionality in a controlled environment.
- Integrating with other Nix-based projects.
- Learning and experimenting with MCP server implementations.
Add to your AI client
Use these steps to connect MCP server in Python in Cursor, Claude, VS Code, and other MCP-compatible apps. The same JSON appears in the Use with menu above for one-click copy.
Cursor
Add this to your .cursor/mcp.json file in your project root, then restart Cursor.
.cursor/mcp.json
{
"mcpServers": {
"minimal-mcp-in-nix-mccartykim": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-minimal-mcp-in-nix-mccartykim"
]
}
}
}Claude Desktop
Add this server entry to the mcpServers object in your Claude Desktop config, then restart the app.
~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)
{
"mcpServers": {
"minimal-mcp-in-nix-mccartykim": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-minimal-mcp-in-nix-mccartykim"
]
}
}
}Claude Code
Add this to your project's .mcp.json file. Claude Code will detect it automatically.
.mcp.json (project root)
{
"mcpServers": {
"minimal-mcp-in-nix-mccartykim": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-minimal-mcp-in-nix-mccartykim"
]
}
}
}VS Code (Copilot)
Add this to your .vscode/mcp.json file. Requires the GitHub Copilot extension with MCP support enabled.
.vscode/mcp.json
{
"servers": {
"minimal-mcp-in-nix-mccartykim": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-minimal-mcp-in-nix-mccartykim"
]
}
}
}Windsurf
Add this to your Windsurf MCP config file, then restart Windsurf.
~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"minimal-mcp-in-nix-mccartykim": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-minimal-mcp-in-nix-mccartykim"
]
}
}
}Cline
Open Cline settings, navigate to MCP Servers, and add this server configuration.
Cline MCP Settings (via UI)
{
"mcpServers": {
"minimal-mcp-in-nix-mccartykim": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-minimal-mcp-in-nix-mccartykim"
]
}
}
}FAQ
What is the purpose of this project?
This project serves as a minimal example of an MCP server using Python and Nix, suitable for demonstrations and learning.
How do I run the server?
You can run the server by using the command provided in the Claude configuration after initializing the Nix flake.
Is this project suitable for production use?
This is a minimal demo project and may not be suitable for production without further development and testing.