Demonstrates using pforge to create HTTP tool handlers that proxy REST APIs.
Provides GitHub API access through MCP tools:
get_user- Fetch user informationget_repos- Get user repositoriessearch_repos- Search for repositories
All without writing any handler code - just YAML configuration!
See pforge.yaml - all tools are defined declaratively:
tools:
- type: http
name: get_user
endpoint: "https://api.github.com/users/{{username}}"
method: GET
headers:
User-Agent: "pforge-example"- HTTP Handler: No code needed for REST API tools
- URL Templates:
{{username}}parameter substitution - Custom Headers: User-Agent, Accept, etc.
- Multiple Endpoints: Different API calls from one config
cd examples/rest-api-proxy
cargo run- pforge reads
pforge.yaml - Creates HTTP handlers automatically
- Handles parameter substitution
- Manages request/response
Zero Rust code for the API handlers - pure configuration!