Connect NationsGlory to Claude: Manage Webhooks, Nabot & API Access
Learn how to connect NationsGlory to Claude using a generated MCP server. Automate webhooks, query MMR, and manage API access with natural language.
If you are managing NationsGlory game servers at scale, you likely need a way to automate administrative workflows like syncing webhooks, analyzing MMR data, and interacting with the Nabot AI assistant. To do this using Anthropic's Claude, you need a Model Context Protocol (MCP) server. This server acts as the critical translation layer between Claude's LLM function calls and NationsGlory's REST API. You can either spend weeks building and maintaining this custom middleware (see our analysis on the hidden costs of custom MCP servers), or use a managed integration platform like Truto to dynamically generate a secure, authenticated managed MCP server for Claude in seconds.
If your team relies on OpenAI's models, check out our guide on connecting NationsGlory to ChatGPT or explore our architectural overview on connecting NationsGlory to AI Agents for broader deployment strategies.
Giving an AI agent read and write access to a gaming ecosystem like NationsGlory presents unique engineering hurdles. You have to navigate undocumented response schemas, handle legacy deprecated endpoints, and manage rate limits without dropping critical data. This guide breaks down exactly how to use Truto to generate a secure, managed MCP server for NationsGlory, connect it natively to Claude Desktop, and execute complex in-game data analytics and webhook management workflows using natural language.
The Engineering Reality of the NationsGlory API
A custom MCP server is essentially a self-hosted integration layer. While the open MCP standard provides a predictable framework for models to discover tools, the reality of implementing it against the NationsGlory API is far from straightforward. If you decide to build a custom MCP server, you own the entire API lifecycle. Here are the specific challenges you will face:
The Deprecated Endpoints Trap
The NationsGlory API has undergone significant routing changes, leaving a massive footprint of deprecated endpoints (living under the /deprecated/ path). If you dynamically map an OpenAPI spec to MCP tools without strict curation, you will expose Claude to dozens of redundant endpoints like list_all_nations_glory_webhooks versus list_all_nations_glory_webhook. If Claude chooses the deprecated endpoint, your AI agent workflows will randomly fail as those legacy routes degrade. A managed MCP server allows you to strictly filter out deprecated routes using metadata tags, ensuring the LLM only interacts with stable, supported API surface area.
Undocumented Response Schemas
Many critical NationsGlory endpoints lack enumerated response schemas in their upstream documentation. For example, the list_all_nations_glory_mmr endpoint returns matchmaking ratings, but the exact JSON keys in the 200 OK response are not publicly documented. If you build your own MCP server, you have to manually execute requests, inspect the payloads, and write custom JSON schemas so Claude knows what data it is looking at. A documentation-driven system handles these schema definitions centrally, ensuring Claude gets predictable inputs and outputs.
Rate Limits and 429 Pass-Through
NationsGlory enforces rate limits to protect server stability. If your AI agent attempts to rapidly pull notations for every country across multiple servers, it will quickly hit a wall. It is a factual reality that Truto does not automatically retry, throttle, or apply exponential backoff when an upstream API returns an HTTP 429 Too Many Requests error. Instead, Truto passes that 429 error directly back to the caller (Claude). However, Truto normalizes the upstream rate limit information into standardized IETF headers (ratelimit-limit, ratelimit-remaining, ratelimit-reset). This allows the caller - whether it is Claude Desktop or a custom LangGraph agent - to read the headers and implement intelligent, mathematically sound backoff logic on its own.
How to Generate a NationsGlory MCP Server with Truto
Truto generates MCP tools dynamically based on integration resources and documentation, following an auto-generated tools architecture. Tools are never pre-built or cached - they are generated at runtime when Claude requests them via the tools/list protocol method. You can create your NationsGlory MCP server through the UI or programmatically via the API.
Method 1: Via the Truto UI
If you prefer a visual interface, you can generate your server in less than a minute:
- Log in to your Truto dashboard and navigate to the integrated account page for your NationsGlory connection.
- Click the MCP Servers tab.
- Click Create MCP Server.
- Select your desired configuration. You can apply filters to restrict the server to specific tags or HTTP methods (e.g.,
readoperations only). - Click Create and securely copy the generated MCP server URL (e.g.,
https://api.truto.one/mcp/a1b2c3d4e5f6...).
Method 2: Via the Truto API
For platform engineers building multi-tenant AI systems, you can programmatically provision MCP servers per customer. Send a POST request to /integrated-account/:id/mcp.
curl -X POST https://api.truto.one/integrated-account/<integrated_account_id>/mcp \
-H "Authorization: Bearer <YOUR_TRUTO_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"name": "NationsGlory Webhooks and Analytics MCP",
"config": {
"methods": ["read", "write", "custom"]
}
}'The API returns a securely hashed token and the full server URL:
{
"id": "mcp_srv_778899",
"name": "NationsGlory Webhooks and Analytics MCP",
"config": { "methods": ["read", "write", "custom"] },
"expires_at": null,
"url": "https://api.truto.one/mcp/a1b2c3d4e5f6..."
}This URL encodes the specific NationsGlory account and the configuration filters. It is fully self-contained - the URL alone is enough to authenticate and serve tools to the client.
How to Connect the MCP Server to Claude
Once you have your Truto MCP URL, connecting it to Claude is a matter of configuration. The Truto server communicates using JSON-RPC 2.0 messages over standard HTTP POST requests, which means it works seamlessly with both the Claude Desktop app and enterprise agent environments.
Method A: Via the Claude UI (Settings)
If you are using an AI chat interface that supports custom connectors via UI (like Claude for Enterprise or ChatGPT Developer Mode):
- Open your settings pane (e.g., Settings -> Integrations -> Add MCP Server).
- Provide a recognizable name like "NationsGlory Admin Tools".
- Paste the Truto MCP URL into the endpoint field.
- Click Add or Save.
- Claude will immediately ping the endpoint, execute the
initializehandshake, and calltools/listto populate its context window with the NationsGlory tools.
Method B: Via Manual Config File (Claude Desktop)
For Claude Desktop running locally, you define the server using the claude_desktop_config.json file. Because Truto MCP servers act as standard Server-Sent Events (SSE) endpoints, you can use the official @modelcontextprotocol/server-sse transport.
Open your config file:
- Mac:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
Add the NationsGlory server configuration:
{
"mcpServers": {
"nationsglory-admin": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-sse",
"--url",
"https://api.truto.one/mcp/a1b2c3d4e5f6..."
]
}
}
}Restart Claude Desktop. The application will initialize the MCP connection and you will see the "plug" icon indicating the tools are ready to use.
NationsGlory Hero Tools
When Claude lists the tools, it receives a flat array of available operations mapped directly from the NationsGlory integration resources. Here are the highest-leverage tools available for your LLM workflows.
list_all_nations_glory_webhook
This tool retrieves all webhooks currently registered in your NationsGlory account. It is critical for auditing your event architecture to ensure automated notifications are routing to the correct endpoints.
Returns: url, eventType.
"Claude, list all the webhooks currently registered in our NationsGlory account and group them by event type."
create_a_nations_glory_webhook
This tool registers a new webhook in NationsGlory. This is primarily used to receive real-time notifications about in-game events, player status changes, or country updates directly to your Discord or internal APIs.
Returns: url, eventType.
"Claude, create a new webhook in NationsGlory pointing to 'https://api.mydomain.com/ng-alerts' for the 'country_update' event type."
list_all_nations_glory_mmr
Retrieves the Matchmaking Rating (MMR) records from the NationsGlory public API. This is heavily utilized by data analysts looking to track player or country performance over time.
Optional parameters: server (to target a specific colored server, e.g., 'blue', 'red').
"Claude, fetch the MMR records for the 'blue' server and summarize the top 10 ratings in a markdown table."
list_all_nations_glory_notations
Retrieves detailed country notations (scores/evaluations) for a specified week, country, and server. This is essential for auditing country performance and administrative compliance within the game world.
Optional parameters: week (defaults to 2801), country (defaults to france), server (defaults to blue).
"Claude, get the notations for the country 'france' on the 'blue' server for week 2950 and tell me what their economy score was."
list_all_nations_glory_country
Lists all countries available on a specific NationsGlory game server. This acts as a primary discovery tool for agents needing to map the current geopolitical state of the server before executing deeper queries.
Required parameters: server.
"Claude, list all the registered countries on the 'yellow' server and output them as a comma-separated list."
create_a_nations_glory_nabot_message
Sends a message to Nabot, the NationsGlory AI assistant, and receives its reply. You can supply a session_uid to persist conversation memory across requests. This allows your Claude agent to effectively proxy and analyze conversations with the native game assistant.
Returns: message.
"Claude, send a message to Nabot asking 'What are the current rules for declaring war?' and summarize its response."
For a complete list of all 30+ endpoints, including OAuth management, auction house data (HDV), and planning tasks, view the complete NationsGlory integration page.
Workflows in Action
Providing an LLM with these tools allows it to execute complex, multi-step tasks across the NationsGlory API without manual script writing. Here is how Claude handles real-world requests.
Workflow 1: Auditing and Provisioning Webhooks
Server administrators frequently need to ensure that their alerting infrastructure is correctly hooked up to NationsGlory. Instead of writing custom curl scripts, you can ask Claude to handle the audit and provisioning.
"Claude, check our NationsGlory account to see if we have a webhook set up for 'country_events'. If we do not, please create one pointing to 'https://api.ourdiscordbot.com/ng-events'."
Execution Steps:
- Claude calls
list_all_nations_glory_webhookto retrieve the current active webhook registrations. - Claude parses the JSON response, scanning the
eventTypefield for "country_events". - Upon finding that the event type is missing, Claude calls
create_a_nations_glory_webhookwith the URLhttps://api.ourdiscordbot.com/ng-eventsand the required event type. - Claude responds to the user confirming the new webhook ID and URL have been successfully registered.
sequenceDiagram
participant User as User
participant Claude as Claude Desktop
participant Truto as Truto MCP Router
participant Upstream as NationsGlory API
User->>Claude: "Check and create webhook..."
Claude->>Truto: call tool "list_all_nations_glory_webhook"
Truto->>Upstream: GET /webhooks
Upstream-->>Truto: Return array of webhooks
Truto-->>Claude: JSON-RPC Result
Claude->>Claude: Analyze data (missing event)
Claude->>Truto: call tool "create_a_nations_glory_webhook"
Truto->>Upstream: POST /webhooks
Upstream-->>Truto: Return 201 Created
Truto-->>Claude: JSON-RPC Result
Claude-->>User: "Webhook successfully created."Workflow 2: Cross-Referencing MMR and Country Notations
Data analysts or server moderators tracking faction balance often need to correlate player skill (MMR) with geopolitical success (Notations). Claude can seamlessly chain these API calls.
"Claude, fetch the MMR records for the 'red' server. Then, pull the latest notations for the country 'spain' on that same server and give me a brief report on how their notation aligns with the top MMR ratings."
Execution Steps:
- Claude calls
list_all_nations_glory_mmrpassingserver: "red". - Claude analyzes the raw MMR data array, identifying the top performing players.
- Claude calls
list_all_nations_glory_notationspassingcountry: "spain"andserver: "red". - Claude synthesizes the two datasets, cross-referencing player names from the MMR list against the roster of the Spanish faction, and outputs a formatted markdown report detailing the correlation.
Security and Access Control
Because Truto exposes direct API access via these tools, securing the MCP server is critical, especially when dealing with webhooks or OAuth endpoints. Truto provides several architectural controls at the token level to lock down access:
- Method Filtering: Use
config.methodsduring server creation to restrict operations. Passing["read"]ensures Claude can only callgetandlistmethods, preventing the LLM from accidentally deleting a webhook or creating an OAuth service. - Tag Filtering: Use
config.tagsto limit the server's scope to specific resource groups. You can restrict an agent so it only sees tools related tonotationsandmmr, completely hiding administrative tools. - Extra Authentication: Setting
require_api_token_auth: trueadds a second layer of security. The MCP client must provide a valid Truto API token in theAuthorizationheader. If a URL leaks, it is useless without the accompanying API token. - Automatic Expiration: Setting
expires_atgives the MCP server a strict Time-to-Live (TTL). Truto schedules a Durable Object alarm to automatically delete the token and flush it from edge KV storage at the exact expiration time. This is ideal for granting temporary access to contractors or short-lived AI agents.
Integrating AI into legacy or undocumented APIs like NationsGlory does not require a massive engineering effort. By generating a dynamic MCP server through Truto, you bypass the friction of schema mapping, pagination logic, and manual endpoint configuration. You give Claude instant, structured access to your gaming infrastructure, protected by enterprise-grade token scopes and rigorous access controls. Build the tools once, and let your AI agents handle the rest.
FAQ
- Does Truto automatically retry NationsGlory API requests when rate limited?
- No. Truto passes HTTP 429 Too Many Requests errors directly back to the caller (Claude). However, Truto normalizes the upstream rate limit data into standard headers (ratelimit-limit, ratelimit-remaining, ratelimit-reset) so your agent can implement accurate backoff logic.
- How do I prevent Claude from using deprecated NationsGlory endpoints?
- You can use Truto's tag and method filtering during MCP server creation. By strictly defining which tags are allowed, you omit all deprecated tools from the tools list returned to Claude.
- Can I connect the Truto MCP server directly to Claude Desktop?
- Yes. Truto MCP servers use JSON-RPC over HTTP POST. You can connect it to Claude Desktop by adding the @modelcontextprotocol/server-sse transport to your claude_desktop_config.json file and pointing it at the Truto URL.
- How does Truto handle undocumented NationsGlory response schemas?
- Truto uses central documentation records to define query and body schemas. These records ensure that even if the upstream API is undocumented, the MCP tools generated by Truto have explicit JSON schemas that Claude can understand and utilize.