Skip to main content

Add your description here

Project description

MCP Base

A solid, foundational starting point for MCP projects. MCP Base is a production-ready, extensible template for building Model Context Protocol (MCP) servers in Python. Rapidly create, extend, and deploy MCP servers that expose tools, prompts, and resources to LLMs and agentic clients.


๐Ÿš€ What is This?

This is a Python starter baseโ€”not a specific server implementation. It provides a modular, well-documented foundation for building your own MCP servers in Python, supporting multiple transport layers (STDIO, SSE, HTTP, etc.), and demonstrating best practices for security, extensibility, and maintainability.


๐Ÿ—๏ธ Architecture Overview

.
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ base/                # Base classes for tools, prompts, resources
โ”‚   โ”œโ”€โ”€ tools/               # Example tools (filesystem, API, prompt, etc.)
โ”‚   โ”œโ”€โ”€ resources/           # Example resources (static/dynamic)
โ”‚   โ”œโ”€โ”€ prompts/             # Example prompts (text generation, summarization)
โ”‚   โ”œโ”€โ”€ transports/          # Transport layer implementations & docs
โ”‚   โ”‚   โ”œโ”€โ”€ stdio/
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ README.md
โ”‚   โ”‚   โ”œโ”€โ”€ sse/
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ README.md
โ”‚   โ”‚   โ””โ”€โ”€ ...
โ”‚   โ”œโ”€โ”€ config.py            # Configuration and environment management
โ”‚   โ”œโ”€โ”€ server.py            # Server instantiation and registration
โ”‚   โ””โ”€โ”€ main.py              # Entrypoint: selects transport, starts server
โ”œโ”€โ”€ tests/                   # Example tests for tools/resources
โ”œโ”€โ”€ Dockerfile               # Containerized deployment
โ”œโ”€โ”€ requirements.txt / pyproject.toml
โ”œโ”€โ”€ README.md                # This file
โ”œโ”€โ”€ CONTRIBUTING.md
โ””โ”€โ”€ ...

โœจ Features

  • Multi-Transport Support: STDIO, SSE, HTTP, and more (see /src/transports/)
  • Modular Tools/Prompts/Resources: Add new features by creating a class and registering it
  • Type-Safe Input Validation: Uses Pydantic for schemas
  • Security Best Practices: Directory sandboxing, input validation, error handling
  • Extensible & Maintainable: Clean separation of concerns, base classes, and registries
  • Production-Ready: Logging, environment management, Docker support
  • Comprehensive Documentation: For users and contributors

๐Ÿ› ๏ธ Getting Started

1. Install Dependencies

pip install -r requirements.txt

2. Configure Environment

Copy .env.example to .env and fill in required values.

3. Run the Server

STDIO Transport:

python main.py --transport=stdio

SSE/HTTP Transport: See /src/transports/sse/README.md and /src/transports/http/README.md for details.


๐Ÿงฉ Adding Tools, Prompts, and Resources

Tools

  • Create a new class in /src/tools/ inheriting from BaseTool
  • Implement the required methods and input schema
  • Register the tool in the tool registry

Prompts

  • Create a new class in /src/prompts/ inheriting from BasePrompt
  • Implement the required methods and input schema
  • Register the prompt in the prompt registry

Resources

  • Add static or dynamic resources in /src/resources/
  • Register them in the resource registry

๐Ÿ”Œ Supported Transports

  • STDIO: For CLI and agentic integration (see /src/transports/stdio/README.md)
  • SSE: For server-sent events and web clients (see /src/transports/sse/README.md)
  • HTTP: For RESTful or web-based integration (see /src/transports/http/README.md)

Each transport is modular and can be extended or replaced.


๐Ÿ›ก๏ธ Security & Best Practices

  • All file and directory operations are sandboxed to allowed paths
  • Input validation is enforced for all tool/resource inputs
  • Error handling is consistent and user-friendly
  • Sensitive configuration is managed via environment variables

๐Ÿงช Testing

  • Example tests are provided in /tests/
  • Use Pytest as the test runner
  • See CONTRIBUTING.md for test guidelines

๐Ÿค Contributing

We welcome contributions! Please see CONTRIBUTING.md for guidelines, code style, and PR process.


๐Ÿ“š Further Reading


๐Ÿ“ License

MIT License. See LICENSE for details.


๐Ÿ’ฌ Community & Support


MCP Base is the recommended starting point for all new Python MCP server projects. Fork, extend, and contribute improvements!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

iflow_mcp_josharsh_mcp_server-0.1.1.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

iflow_mcp_josharsh_mcp_server-0.1.1-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file iflow_mcp_josharsh_mcp_server-0.1.1.tar.gz.

File metadata

  • Download URL: iflow_mcp_josharsh_mcp_server-0.1.1.tar.gz
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for iflow_mcp_josharsh_mcp_server-0.1.1.tar.gz
Algorithm Hash digest
SHA256 40d53ec70d94cb1ec89c0238c6dd78607972af92e6b4189d16640603934d90ee
MD5 8135a389fb994e07a1c7210aa6659e27
BLAKE2b-256 bf7c4babeb870af632df8f7dfadfef7fb83f843bc222c1fd360911c2eb66ac67

See more details on using hashes here.

File details

Details for the file iflow_mcp_josharsh_mcp_server-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: iflow_mcp_josharsh_mcp_server-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for iflow_mcp_josharsh_mcp_server-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1a514d2078b1eba57c9a974fabfd1001451772a5d4f975cabb2512e8b4473bc5
MD5 4efc0d00a689af61bbb49724f476a961
BLAKE2b-256 83bba946ea42eaee89f004c1f05f2e8ba1c1b5a9234b182bbdffce50b477b2d4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page