mcpforge

v1.0.0Developer Toolsstable

A Python library to build MCP servers with decorators, auto-generating JSON Schema from type hints and including built-in filesystem and HTTP servers.

aiclaudemcpmodel-context-protocolopenai
Share:
17
Stars
0
Downloads
0
Weekly
0/5

What is mcpforge?

mcpforge is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to python library to build mcp servers with decorators, auto-generating json schema from type hints and including built-in filesystem and http servers.

A Python library to build MCP servers with decorators, auto-generating JSON Schema from type hints and including built-in filesystem and HTTP servers.

This server falls under the Developer Tools category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • A Python library to build MCP servers with decorators, auto-

Use Cases

MCP server building with decorators
Automatic JSON Schema generation
vigilancetrent

Maintainer

LicenseMIT License
Languagetypescript
Versionv1.0.0
UpdatedMay 11, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx mcpforge

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use mcpforge

mcpforge is a Python library that makes building MCP servers as simple as decorating class methods, automatically generating JSON Schema from Python type hints and docstrings so you can turn any Python function into a callable MCP tool without writing boilerplate protocol code. It ships with two built-in ready-to-use server implementations — FilesystemTools for sandboxed file operations and HttpTools for fetching URLs — and supports both tools and resources as first-class concepts. Python developers use it to prototype and ship custom MCP integrations quickly, connecting their existing Python code to Claude, OpenAI, and other MCP-compatible AI clients.

Prerequisites

  • Python 3.9 or later
  • pip for installing the mcpforge package
  • An MCP-compatible client such as Claude Desktop or Cursor
  • Basic familiarity with Python type hints and class-based design
  • No external API keys required for the framework itself
1

Install mcpforge

Install the mcpforge package from PyPI using pip.

pip install mcpforge
2

Create your first MCP server

Define a class with the @serve decorator and annotate methods with @tool. Type hints and docstrings become the JSON Schema that clients see. Save this as, for example, hello.py.

from mcpforge import serve, tool

@serve(name="hello", version="0.1.0")
class HelloTools:
    @tool
    def greet(self, name: str = "world") -> str:
        """Say hello to someone."""
        return f"Hello, {name}!"
3

Run the server

Use the mcpforge CLI to start your server. The argument format is module:ClassName.

python -m mcpforge run hello:HelloTools
4

Use a built-in server (optional)

mcpforge ships with FilesystemTools (sandboxed list_dir, read_file, search) and HttpTools (fetch_url with size limits). Run them directly without writing any code.

# Filesystem server:
python -m mcpforge run mcpforge.builtins:FilesystemTools

# HTTP server:
python -m mcpforge run mcpforge.builtins:HttpTools
5

Configure Claude Desktop

Add the server to claude_desktop_config.json. Point command at python and args at the mcpforge run command for your module. Update cwd to the directory containing your Python module.

{
  "mcpServers": {
    "my-tools": {
      "command": "python",
      "args": ["-m", "mcpforge", "run", "hello:HelloTools"],
      "cwd": "/path/to/your/project"
    }
  }
}

mcpforge Examples

Client configuration (Claude Desktop)

Example claude_desktop_config.json entry running a custom mcpforge server. Update the module name and cwd to match your project.

{
  "mcpServers": {
    "my-tools": {
      "command": "python",
      "args": ["-m", "mcpforge", "run", "hello:HelloTools"],
      "cwd": "/Users/yourname/my-mcp-project"
    }
  }
}

Prompts to try

Sample prompts once an mcpforge-based server is connected to Claude Desktop.

- "Say hello to Alice using the greet tool."
- "List the files in /Users/me/documents using the filesystem server."
- "Read the file /Users/me/notes.txt."
- "Fetch the content of https://example.com using the HTTP tool."
- "What tools does the my-tools MCP server expose?"

Troubleshooting mcpforge

ModuleNotFoundError when running the server

Ensure mcpforge is installed in the same Python environment that is invoked by the command in your MCP config. Use an absolute path to the Python binary (e.g. /Users/yourname/.venv/bin/python) to avoid virtual environment confusion.

Type hints are not generating correct JSON Schema for tool arguments

mcpforge uses Python's inspect module to read type annotations. Ensure you are using standard types (str, int, float, bool, list, dict) or Pydantic models. Avoid Union types without explicit Optional annotation, and make sure all method parameters have type hints.

Tools are not appearing in Claude Desktop after adding the config

Verify the cwd path exists and contains your Python module. Test the server startup command manually in a terminal: 'python -m mcpforge run hello:HelloTools'. Fix any Python errors before restarting Claude Desktop.

Frequently Asked Questions about mcpforge

What is mcpforge?

mcpforge is a Model Context Protocol (MCP) server that python library to build mcp servers with decorators, auto-generating json schema from type hints and including built-in filesystem and http servers. It connects AI assistants to external tools and data sources through a standardized interface.

How do I install mcpforge?

Follow the installation instructions on the mcpforge GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with mcpforge?

mcpforge works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is mcpforge free to use?

Yes, mcpforge is open source and available under the MIT License license. You can use it freely in both personal and commercial projects.

Browse More Developer Tools MCP Servers

Explore all developer tools servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "mcpforge": { "command": "npx", "args": ["-y", "mcpforge"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use mcpforge?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides