Skip to content

vimaleshbe/custom-mcp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

generic-mcp: Model Context Protocol Server Template

A robust, extensible Model Context Protocol (MCP) server template for building tool-based automation APIs. Easily add, expose, and document any set of tools (file, database, codegen, etc.) for LLM agents and automation workflows.

Features

  • Easily add and expose any tool (file, database, codegen, etc.) as an MCP tool
  • RESTful tool interface for LLM agents and automation
  • OpenAPI schema available at /mcp/openapi.json
  • Built with Python, FastMCP, Pydantic, and Uvicorn

Project Structure

generic-mcp/
├── mcp_server.py         # Main MCP server entrypoint (rename as needed)
├── README.md             # This file
├── pyproject.toml        # Python project config
└── ...

Setup

  1. Install dependencies:

    uv pip install -r requirements.txt
  2. Run the server:

    uv run python file_mcp.py --root <workspace-root>
    # Example:
    uv run python file_mcp.py --root C:\Users\yourname\ai-play-ground

Usage

  • The server exposes your custom tools via HTTP at http://localhost:8123/mcp.
  • OpenAPI schema: http://localhost:8123/mcp/openapi.json
  • Use an MCP-compatible agent or client to call your defined tools.

Tool API

Define your own tools using the @mcp.tool() decorator in your main server file. Each tool will be automatically exposed via HTTP and documented in the OpenAPI schema.

Example:

@mcp.tool()
def my_tool(param1: str, param2: int) -> dict:
	"""Describe what this tool does."""
	# ...your logic...
	return {"result": ...}

See the OpenAPI schema for details on all available tools and their parameters.

Best Practices

  • Keep all tool logic in your main server file or organize by feature as needed.
  • Use the @mcp.tool() decorator for every tool you want to expose.
  • Log important events and errors using the built-in logger.

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages