Overview
What is stun-mcp?
stun-mcp is an MCP server that sends a STUN (RFC8489) Binding Request to a specified STUN server and returns the result. It is intended for developers or AI agents who need to test or verify STUN connectivity, for example to determine a public IP and port.
How to use stun-mcp?
Install Node.js and build the server. Add the following configuration to your mcp.json file (e.g., in VS Code with Agent mode enabled): { "servers": { "stun": { "type": "stdio", "command": "node", "args": ["/path/to/stun-mcp/build/main.js"] } } }. Then prompt your agent to send a STUN request, for example: "以下のURLにSTUNのリクエストを送り、結果を出力してください stun:stun1.l.google.com:19302".
Key features of stun-mcp
- Sends STUN Binding Requests (RFC8489)
- Returns the STUN response (mapped address, etc.)
- Works as an MCP server over stdio
- Minimal STUN packet processing (basic implementation only)
- Designed for use with AI agents in VS Code
Use cases of stun-mcp
- Testing STUN server reachability from an AI agent
- Obtaining the public IP address and port via STUN
- Verifying NAT traversal capabilities in a development environment
- Automating network diagnostics through natural language prompts
FAQ from stun-mcp
What does stun-mcp do?
It sends a STUN (RFC8489) Binding Request to a given STUN server URL and returns the response, typically the mapped (public) IP address and port.
What are the runtime requirements?
Node.js is required to run the server. The server is executed as a stdio process.
How do I configure stun-mcp?
Add the server configuration to your MCP-compatible client's mcp.json file, specifying the path to the compiled main.js file.
Is there a warning about the implementation?
Yes. The STUN packet processing is implemented with only the minimum necessary functionality – it may not handle all edge cases or extended attributes.
What transport does stun-mcp use?
The server communicates via stdio. No network transport (HTTP, etc.) is used; STUN requests are sent directly over UDP by the server process.