arcade-mcp/libs/arcade-mcp-server/docs/api/mcp_app.md
Eric Gustin 9e4d36b8e3
Local MCP Fixes and Address General Feedback (#586)
# Release Candidate 2
## This PR:
- [x] No more confusing 307 redirect logs when using `/mcp` instead of
`/mcp/` (requested by @shubcodes)
- [x] Fix bug in `arcade configure` for Python < 3.12 (reported by
@evantahler
- [x] Fix bug where tools with unsatisfied secret requirements could
still be executed (reported by @evantahler, @shubcodes)
- [x] Auth providers can now be imported via `from
arcade_mcp_server.auth import Reddit` (requested by @shubcodes)
- [x] Add complete E2E oauth flow for tool calls with informational
errors about how to log into arcade and where to go to authorize
(requested by @evantahler, @shubcodes)
- [x] Add OAuth tool in `arcade new`'s generated server (requested by
@shubcodes)
- [x] Standardize on defaulting to running servers on port 8000
- [x] Improve credentials.yaml reading logic
- [x] CLI user friendliness (requested by @Spartee)
- [x] Remove `arcade serve` CLI command
- [x] Fix race condition in `arcade logout`
- [x] Update docs for desired developer onboarding flow

## Next PRs:
- Get `arcade deploy` working for MCP servers. (Command is hidden for
now)
- Rename all occurrences of `toolkit` to `server`/`tools` and rename all
occurrences of `worker` to `server`
2025-09-29 16:00:47 -07:00

1 KiB

MCPApp

A FastAPI-like interface for building MCP servers with lazy initialization.

MCPApp provides a clean, minimal API for building MCP servers programmatically. It handles tool collection, server configuration, and transport setup with a developer-friendly interface.

Basic Usage

from arcade_mcp_server import MCPApp

app = MCPApp(name="my_server", version="1.0.0")

@app.tool
def greet(name: str) -> str:
    return f"Hello, {name}!"

app.run(host="127.0.0.1", port=8000)

Class Reference

::: arcade_mcp_server.mcp_app.MCPApp

Examples

# --- server.py ---
# Programmatic server creation with a simple tool and HTTP transport

from arcade_mcp_server import MCPApp

app = MCPApp(name="example_server", version="1.0.0")

@app.tool
def echo(text: str) -> str:
    return f"Echo: {text}"

if __name__ == "__main__":
    # Start an HTTP server (good for local development/testing)
    app.run(host="0.0.0.0", port=8000, reload=False, debug=True)
# then run the server
python server.py