3 Likes
1 BranchVal Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
An MCP server that tells you your own public IP address. Runs serverlessly on val.town.
| Name | Description | Inputs |
|---|---|---|
get_ip | Returns the public IP address of the caller | (none) |
Example response
Your IP address is: 203.0.113.42
Point any MCP-compatible client at this val's URL.
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{ "mcpServers": { "ip": { "type": "http", "url": "https://my-ip-mcp.val.run/" } } }
Restart Claude Desktop, then ask: "What's my IP address?"
{ "mcp": { "servers": { "ip": { "type": "http", "url": "https://my-ip-mcp.val.run/" } } } }
# 1 — Handshake curl -s -X POST https://my-ip-mcp.val.run/ \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name":"curl","version":"1.0"}}}' # 2 — Call the tool curl -s -X POST https://my-ip-mcp.val.run/ \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"get_ip","arguments":{}}}'
- Transport:
MCP Streamable HTTP
— a single HTTP endpoint that handles JSON-RPC 2.0 messages via
POST - IP detection: reads the
X-Forwarded-Forheader set by val.town's CDN (first value = real client IP), falling back toX-Real-IP - Stateless: no sessions, no storage, no authentication
- No logging: IP addresses are never stored or logged
| Method | Purpose |
|---|---|
initialize | Handshake — returns server capabilities |
notifications/initialized | Client acknowledgement (202, no body) |
ping | Keep-alive |
tools/list | Returns the get_ip tool descriptor |
tools/call | Invokes get_ip and returns the caller's IP |