Cover image
Try Now
2025-04-08

3 years

Works with Finder

1

Github Watches

0

Github Forks

0

Github Stars

MCP Server

A Model-Controller-Provider (MCP) architecture based server implementation using FastAPI.

Project Structure

.
├── api/              # API routes and endpoints
│   └── v1/          # API version 1
│       ├── __init__.py
│       └── items.py # Item endpoints
├── controllers/      # Business logic and request handlers
│   └── item_controller.py
├── providers/       # Data access and external service integrations
│   └── item_provider.py
├── models/         # Data models and database schemas
│   └── item.py
├── core/          # Core configurations and utilities
│   ├── config.py  # Application configuration
│   └── database.py # Database configuration
├── main.py        # Application entry point
├── requirements.txt # Project dependencies
├── environment.yml  # Conda environment file
└── README.md      # Project documentation

Features

  • FastAPI-based REST API: High-performance, easy to use, fast to code
  • MCP Architecture:
    • Models: Data structures and database schemas
    • Controllers: Business logic and request handling
    • Providers: Data access and external service integration
  • Modern Tech Stack:
    • SQLAlchemy for ORM
    • Pydantic for data validation
    • FastAPI for API framework
    • SQLite for development database
  • API Features:
    • Automatic OpenAPI documentation
    • Request validation
    • Response serialization
    • CORS middleware
    • Type checking

Setup

  1. Create a Conda environment:
# Create a new environment with Python 3.12
conda create -n codeMcpServer python=3.12
# Activate the environment
conda activate codeMcpServer
  1. Install dependencies:
# Using the provided environment file (recommended)
conda env create -f environment.yml

# OR using pip 
pip install -r requirements.txt

# OR using conda with conda-forge channel
conda config --add channels conda-forge
conda install --file requirements.txt
  1. Run the server:
uvicorn main:app --reload

The server will start at http://localhost:8000

Dependencies

Key dependencies in this project:

  • Python 3.12.9
  • FastAPI 0.112.2
  • SQLAlchemy 2.0.37
  • Pydantic 2.11.2
  • Uvicorn 0.32.1
  • Python-dotenv 0.21.0

For a complete list, see environment.yml or requirements.txt.

Environment Management

Export Environment

To export your environment for sharing:

# Export full environment with exact versions (without prefix)
conda env export | grep -v "^prefix: " > environment.yml

# Or export only manually installed packages
conda env export --from-history > environment.yml

Import Environment

To recreate an environment from the exported file:

conda env create -f environment.yml

API Documentation

Once the server is running, you can access:

  • Interactive API documentation (Swagger UI): http://localhost:8000/docs
  • Alternative API documentation (ReDoc): http://localhost:8000/redoc

API Endpoints

Items API (/api/v1/items)

  • GET /api/v1/items/: List all items
  • GET /api/v1/items/{item_id}: Get a specific item
  • POST /api/v1/items/: Create a new item
  • PUT /api/v1/items/{item_id}: Update an item
  • DELETE /api/v1/items/{item_id}: Delete an item

Development

Project Organization

The project follows the MCP (Model-Controller-Provider) pattern:

  • Models: Define data structures and database schemas
  • Controllers: Handle business logic and request processing
  • Providers: Manage data access and external service integration

Adding New Features

  1. Create the model in models/
  2. Create the provider in providers/
  3. Create the controller in controllers/
  4. Create the API endpoints in api/v1/

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

License

This project is licensed under the terms of the LICENSE file included in the repository.

相关推荐

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • lumpenspace
  • Take an adjectivised noun, and create images making it progressively more adjective!

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • Yusuf Emre Yeşilyurt
  • I find academic articles and books for research and literature reviews.

  • Carlos Ferrin
  • Encuentra películas y series en plataformas de streaming.

  • https://zenepic.net
  • Embark on a thrilling diplomatic quest across a galaxy on the brink of war. Navigate complex politics and alien cultures to forge peace and avert catastrophe in this immersive interstellar adventure.

  • apappascs
  • Descubra la colección más completa y actualizada de servidores MCP en el mercado. Este repositorio sirve como un centro centralizado, que ofrece un extenso catálogo de servidores MCP de código abierto y propietarios, completos con características, enlaces de documentación y colaboradores.

  • ShrimpingIt
  • Manipulación basada en Micrypthon I2C del expansor GPIO de la serie MCP, derivada de AdaFruit_MCP230xx

  • pontusab
  • La comunidad de cursor y windsurf, encontrar reglas y MCP

  • ravitemer
  • Un poderoso complemento Neovim para administrar servidores MCP (protocolo de contexto del modelo)

  • jae-jae
  • Servidor MCP para obtener contenido de la página web con el navegador sin cabeza de dramaturgo.

  • patruff
  • Puente entre los servidores Ollama y MCP, lo que permite a LLM locales utilizar herramientas de protocolo de contexto del modelo

  • av
  • Ejecute sin esfuerzo LLM Backends, API, frontends y servicios con un solo comando.

  • chongdashu
  • Habilite clientes asistentes de IA como Cursor, Windsurf y Claude Desktop para controlar el motor irreal a través del lenguaje natural utilizando el Protocolo de contexto del modelo (MCP).

  • wgpsec
  • 一款基于各大企业信息 API 的工具 , 解决在遇到的各种针对国内企业信息收集难题。一键收集控股公司 解决在遇到的各种针对国内企业信息收集难题。一键收集控股公司 ICP 备案、 Aplicación 、小程序、微信公众号等信息聚合导出。支持 MCP 接入

    Reviews

    1 (1)
    Avatar
    user_I86tO2kU
    2025-04-17

    I've been using code-mcp-server by Protagonistss for a while now, and it has truly enhanced my development workflow. It's user-friendly, robust, and integrates seamlessly into my projects. I highly recommend it to anyone looking for a reliable multi-channel processing server for their coding needs. Check it out on GitHub!