python-mcp-server

gosecCloud/python-mcp-server

3.2

If you are the rightful owner of python-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

The Python MCP Server is a production-grade Model Context Protocol server implemented in Python, designed to provide secure and performant access to developer tooling for LLM clients like Claude Desktop.

Tools
5
Resources
0
Prompts
0

Python MCP Server

Python 3.11+ License: MIT

A production-grade Model Context Protocol (MCP) server implemented in Python, providing LLM clients like Claude Desktop with secure, performant access to comprehensive developer tooling.

✨ Features

40+ Tools Across 9 Capability Domains

DomainToolsDescription
File Operations7 toolsRead, write, edit, list, move, delete files with workspace confinement
Code Search4 toolsFull-text search (FTS5), AST parsing, symbol lookup, incremental indexing
Command Execution2 toolsSandboxed subprocess execution with streaming output and cancellation
Git Operations5 toolsStatus, diff, commit, log, branch management with safe guards
LSP Integration4 toolsDiagnostics, completions, hover, formatting across multiple languages
Testing3 toolsRun tests, coverage reports, framework auto-detection (pytest, etc.)
Dependency Management3 toolsList, install, update packages (pip/uv/poetry/npm)
Code Analysis3 toolsLinting (ruff), complexity metrics, security scanning (bandit)
Project Context3 toolsStructure discovery, documentation reading, build config detection

Security-First Design

  • Multi-Layer Defense: Workspace confinement, platform-specific sandboxing, policy engine, audit logging
  • Approval Workflows: Dry-run previews for destructive operations (write, delete, commit, install)
  • Tamper-Evident Audit: Merkle chain for immutable operation tracking
  • Platform Sandboxing: Linux namespaces, macOS sandbox-exec, Windows Job Objects

Performance & UX

  • Streaming: Real-time progress for long-running operations
  • Cancellation: Interrupt any running task via client request
  • Caching: Multi-tier (memory + SQLite/LMDB) for files, search index, LSP results
  • Incremental Indexing: File watcher triggers targeted re-indexing

Extensibility

  • Plugin System: Clean entry points for custom tools
  • Per-Plugin Policies: Granular security controls
  • Multi-Language: LSP support for Python, TypeScript, and more

🚀 Quick Start

Installation

From Git Repository (Recommended)
# Latest version from main branch
pip install git+https://github.com/gosecCloud/python-mcp-server.git

# Specific version tag
pip install git+https://github.com/gosecCloud/python-mcp-server.git@v0.1.0

# With optional dependencies
pip install "git+https://github.com/gosecCloud/python-mcp-server.git#egg=mcp-python-server[telemetry,fast]"

# Using uv (faster)
uv pip install git+https://github.com/gosecCloud/python-mcp-server.git
For Development
# Clone repository
git clone https://github.com/gosecCloud/python-mcp-server.git
cd python-mcp-server

# Install in editable mode with dev dependencies
pip install -e ".[dev]"

# Or using uv
uv pip install -e ".[dev]"
Verify Installation
# Check version
python -c "import mcp; print(f'MCP Server v{mcp.__version__}')"

# Check CLI availability
mcp --help
mcp-python-server --help

Configuration

Initialize a project with default configuration:

mcp init

This creates .mcp/config.yaml:

workspace:
  root: "."

commands:
  allow:
    - "pytest"
    - "uv"
    - "poetry"
    - "rg"
  block:
    - "rm"
    - "dd"

git:
  safe_branches:
    - "main"
    - "master"

lsp:
  servers:
    python:
      command: "pylance-langserver"
      args: ["--stdio"]

Running the Server

# STDIO mode (for Claude Desktop)
mcp-python-server --transport stdio --config .mcp/config.yaml

# WebSocket mode (future)
mcp-python-server --transport ws --port 8080

Claude Desktop Integration

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "python-mcp": {
      "command": "mcp-python-server",
      "args": ["--transport", "stdio", "--config", "/path/to/project/.mcp/config.yaml"]
    }
  }
}

📖 Documentation

  • : Complete system design, layer-by-layer breakdown, security model
  • : Project goals, design philosophy, example workflows
  • : Roadmap, acceptance criteria, testing strategy
  • : Development guide for AI assistants

API Documentation

(Coming soon - Phase 7)

Guides

(Coming soon - Phase 7)

🛠️ Development

Setup

# Clone repository
git clone https://github.com/gosecCloud/python-mcp-server.git
cd python-mcp-server

# Create virtual environment
python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate

# Install dependencies
pip install -e ".[dev]"

Testing

# Run all tests
pytest

# Run with coverage
pytest --cov=mcp --cov-report=html

# Run specific test file
pytest tests/unit/test_workspace.py

# Run security tests
pytest -m security

Linting & Type Checking

# Lint with ruff
ruff check .

# Auto-fix issues
ruff check --fix .

# Format code
ruff format .

# Type check
mypy src/

🗺️ Roadmap

Current Phase: Phase 0 - Scaffolding (Weeks 1-2)

  • Architecture design
  • Project structure
  • CI/CD setup
  • Complete Phase 0 tasks

Upcoming Phases

PhaseDurationFocus
Phase 1Weeks 3-4Core Framework (transport, registry, workspace, config)
Phase 2Weeks 5-6File & Command Tools
Phase 3Weeks 7-8Git & Search
Phase 4Weeks 9-10LSP & Testing
Phase 5Weeks 11-12Analysis & Dependencies
Phase 6Weeks 13-14Security Hardening
Phase 7Weeks 15-16Polish & Documentation
Phase 8Weeks 17-18Testing & Release (v1.0.0)

See for full roadmap.

🤝 Contributing

We welcome contributions! Please see for guidelines.

How to Contribute

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Areas for Contribution

  • Core Features: Implement tools from the roadmap
  • Platform Support: Improve sandboxing for Linux/macOS/Windows
  • LSP Integration: Add support for new languages
  • Testing: Add unit/integration/security tests
  • Documentation: Improve guides, examples, API docs
  • Plugins: Build community plugins

📊 Project Status

ComponentStatusProgress
Architecture Design✅ Complete100%
Project Scaffolding🔄 In Progress60%
Core Framework📋 Planned0%
File Operations📋 Planned0%
Code Search📋 Planned0%
Command Execution📋 Planned0%
Git Operations📋 Planned0%
LSP Integration📋 Planned0%
Testing Runner📋 Planned0%
Dependency Management📋 Planned0%
Code Analysis📋 Planned0%

🔒 Security

Security is a first-class concern. Please report vulnerabilities via:

See our for details.

📄 License

This project is licensed under the MIT License - see the file for details.

🙏 Acknowledgments

📬 Contact


Built with ❤️ by GoSec Cloud