AI Agent Integration (MCP)
Connect AI agents like Claude, ChatGPT, and custom applications to the GoSmarter API using the Model Context Protocol (MCP) server.
What is MCP?
The Model Context Protocol (MCP) is a standardised way for AI agents to interact with APIs and resources. The GoSmarter MCP server provides:
- API Tools — All GoSmarter API operations available as callable tools
- Documentation Resources — Read-only access to product documentation
- Standardised Protocol — Works with any MCP-compatible AI agent
- Flexible Auth — API keys for automation; Bearer tokens for user-delegated access
Authentication for AI Agents
Option 1: API key (recommended for scripts and custom agents)
API keys don't expire and need no token refresh logic — the right choice for AI agents, automation scripts, and long-running integrations.
Code
Get a key from My Account → API Keys in this portal. See the API Keys guide for rotation and revocation.
Option 2: Bearer token (user-delegated access or Claude Desktop)
Use when the agent must act on behalf of a specific user, or when using a standard MCP host like Claude Desktop that only supports the Authorization: header.
Code
Tokens expire after 1 hour — see Authentication for token acquisition and caching.
Quick Start with Claude Desktop
Claude Desktop uses @modelcontextprotocol/server-fetch, which only sends the Authorization: header. Use a Bearer token for this setup.
1. Install Claude Desktop
Download from claude.ai/download
2. Get a Bearer token
Code
Contact your GoSmarter administrator for client credentials if you don't have them.
3. Configure Claude Desktop
Edit the Claude Desktop config file:
Mac: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Code
4. Restart Claude Desktop
Claude will now have access to all GoSmarter API operations and documentation.
Quick Start with a Custom Agent (API key)
For programmatic agents and scripts, use an API key — no token acquisition or refresh required.
Python
Code
JavaScript / Node.js
Code
What Can AI Agents Do?
Once connected, AI agents can:
Perform API Operations
Code
Access Documentation
Code
Perform Complex Workflows
Code
Available Tools
The MCP server exposes all backend API operations as tools. See the full list in the API Reference.
Available Documentation Resources
AI agents can read multiple documentation resources including dashboard usage, FAQ, getting started tutorials, glossary, inventory management, mill certificates, optimisation, order management, quick reference, scrap calculator, and troubleshooting guides.
MCP Protocol Reference
All MCP requests use JSON-RPC 2.0:
Code
Always include Accept: application/json, text/event-stream — some transports require it.
Key Management for AI Agents
API key (recommended)
- No expiry — no refresh logic needed
- Rotate via Settings → API Keys → Roll in this portal
- Delete immediately if compromised
- Store in environment variables or a secrets manager — never in source code
Bearer token
- Expires after 1 hour — implement token caching and proactive refresh
- See Authentication for caching patterns
Troubleshooting
406 Not Acceptable
Cause: Missing Accept header.
Fix: Always include Accept: application/json, text/event-stream.
401 Unauthorized (API key)
- Verify the key is valid: Settings → API Keys in this portal
- Check the header name is exact:
GoSmarter-Api-Key - If the key was created before user metadata was populated, delete and recreate it
401 Unauthorized (Bearer token)
- Token has expired — request a new one
- Verify
scope=api://0399c3db-81cb-4a1e-8ff6-9fcfca8dec21/access_as_useris included
Tool Not Found
List available tools first: tools/list. Tool names are case-sensitive.
Resource Not Found
List available resources first: resources/list. URI format: mcp://resources/docs/{path}.
Best Practices
- Prefer API keys for agent integrations — no token expiry to manage
- List tools once at startup — don't list on every request
- Handle errors gracefully — implement retry logic for transient network issues
- Cache tool lists — the available tools don't change between requests
- Respect rate limits — 1000 req/hour
Next Steps
- API Keys — Create, rotate, and revoke API keys
- Authentication — OAuth 2.0 and Bearer token details
- Quick Start — Test the API directly before using MCP
- API Reference — Explore all available operations
Support
- Technical questions: [email protected]

