Skip to content

Arcade MCP Examples

This directory contains examples demonstrating how to build MCP servers with your Arcade tools.

Getting Started

The easiest way to get started is with arcade new:

# Install the CLI
uv pip install arcade-mcp

# Create a new server project with example tools
arcade new my_server
cd my_server

# Run your server
uv run server.py

This creates a complete project with server.py, pyproject.toml, and example tools showing best practices.

Examples Overview

Basic Examples

  1. 00_hello_world.py – Minimal tool example
  2. Single @tool function showing the basics
  3. Run: uv run 00_hello_world.py (or uv run 00_hello_world.py stdio)

  4. 01_tools.py – Creating tools and discovery

  5. Simple parameters, lists, and TypedDict
  6. How the server discovers tools automatically
  7. Run: uv run 01_tools.py

  8. 02_building_apps.py – Building apps with MCPApp

  9. Create an MCPApp, register tools with @app.tool
  10. Run HTTP: uv run 02_building_apps.py
  11. Run stdio: uv run 02_building_apps.py stdio

  12. 03_context.py – Using Context

  13. Access secrets, logging, and user context
  14. Run: uv run 03_context.py

  15. 04_tool_secrets.py – Working with secrets

  16. Use requires_secrets and access masked values
  17. Run: uv run 04_secrets.py

  18. 05_logging.py – Logging with MCP

  19. Demonstrates debug/info/warning/error levels and structured logs
  20. Run: uv run 05_logging.py

  21. 06_tool_organization.py – Tool organization and imports

  22. Demonstrate modular tool organization, importing from files and packages
  23. Run: uv run 06_tool_organization.py

  24. 07_auth.py – Tools that require auth

  25. Create tools that require OAuth scopes
  26. Use Reddit OAuth to fetch posts
  27. Prerequisites: Run arcade login to authenticate with Arcade
  28. Run: uv run 07_auth.py

Running Examples

Most examples can be run directly with Python using uv:

# Run any example file directly
uv run 00_hello_world.py
uv run 02_building_apps.py
uv run 06_tool_organization.py

# With specific transport
uv run server.py stdio  # For Claude Desktop
uv run server.py http   # HTTP by default

# You can also run with python directly
python 00_hello_world.py
python 02_building_apps.py stdio

All example files include proper command-line argument handling with if __name__ == "__main__": blocks.