Skip to main content

A simple wrapper library for FastMCP + Starlette

Project description

README.md

viyv_mcp

viyv_mcp is a simple Python wrapper library for FastMCP and Starlette.
It enables you to quickly create a fully‐configured MCP server project with sample tools, resources, prompts, and external configuration support.

Features

  • Quick Project Creation:
    Use the provided CLI command create-viyv-mcp new <project_name> to generate a new project template with a complete directory structure and sample files.

  • Integrated MCP Server:
    Automatically sets up FastMCP with Starlette and includes auto-registration of local tools, resources, and prompts.

  • Template Inclusion:
    The generated project contains pre-configured templates for:

    • Configuration Files: (e.g. app/config_files/sample_slack.json)
    • Prompts: (e.g. app/prompts/sample_prompt.py)
    • Resources: (e.g. app/resources/sample_echo_resource.py)
    • Tools: (e.g. app/tools/sample_math_tools.py)
    • Additionally, a sample Dockerfile and pyproject.toml for the generated project are included.

Installation

From PyPI

Install viyv_mcp via pip:

pip install viyv_mcp

This installs the package as well as provides the CLI command create-viyv-mcp.

Usage

Creating a New Project Template

After installing the package, run:

create-viyv-mcp new my_mcp_project

This command creates a new directory called my_mcp_project with the following structure:

my_mcp_project/
├── Dockerfile
├── pyproject.toml
├── main.py
└── app/
    ├── config.py
    ├── config_files/
    │   └── sample_slack.json
    ├── prompts/
    │   └── sample_prompt.py
    ├── resources/
    │   └── sample_echo_resource.py
    └── tools/
        └── sample_math_tools.py

Running the MCP Server

  1. Change into your new project directory:

    cd my_mcp_project
    
  2. Use uv to resolve dependencies (this uses the pyproject.toml for dependency management):

    uv sync
    
  3. Start the server with:

    uv run python main.py
    

The server will start on 0.0.0.0:8000 by default. The project is pre-configured to automatically register local modules (tools, resources, prompts) and to attempt bridging any external MCP servers as specified in app/config_files/sample_slack.json.

Project Structure

  • viyv_mcp/
    Contains the core Python package:
    • __init__.py: Re-exports key classes such as ViyvMCP.
    • core.py: Implements the ViyvMCP class that wraps FastMCP and integrates auto-registration, external bridge support, and Starlette integration.
    • cli.py: Implements the CLI entry point (create-viyv-mcp command).
    • templates/: Contains the project template files, including:
      • Dockerfile: For containerizing the generated project.
      • pyproject.toml: For dependency management of the generated project.
      • main.py: Entry point to launch the MCP server.
      • app/: Contains the sample application code:
        • config.py: Basic configuration (e.g., host, port, bridge config directory).
        • config_files/sample_slack.json: Sample external MCP server configuration.
        • prompts/sample_prompt.py: A sample prompt module.
        • resources/sample_echo_resource.py: A sample resource module.
        • tools/sample_math_tools.py: A sample tool module.

Contributing

Contributions are welcome! If you find a bug or have a feature request, please open an issue or create a pull request on GitHub.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contact

For any inquiries, please contact:

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

viyv_mcp-0.1.0.tar.gz (11.9 kB view details)

Uploaded Source

Built Distribution

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

viyv_mcp-0.1.0-py3-none-any.whl (14.1 kB view details)

Uploaded Python 3

File details

Details for the file viyv_mcp-0.1.0.tar.gz.

File metadata

  • Download URL: viyv_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 11.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for viyv_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4669a8d9650afaa946a55a6c5062c7198853bd2e28cb94a0fdfee733ff03fa17
MD5 f47d424285a82a0edafe7c4521f16a44
BLAKE2b-256 0abdd0c97dd6cf20064539020c5939fbb961a36e0585ea2dd698c982ee270948

See more details on using hashes here.

File details

Details for the file viyv_mcp-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: viyv_mcp-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 14.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for viyv_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 72f0eb2360ce7736e78c05f8212bbb415cf0ea7cc7d88d330d2ed98ebca21491
MD5 9ba2bce73da6a878c66fcdb53ef01b5d
BLAKE2b-256 e80383d2e36ac8845342755d3bbaa28dcb770815facac780a8cc46edc51b3775

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