mcp-remote
to connect to remote MCP Servers.
Basic Configuration
To use an MCP Server, you’ll need to configure your client to send your User API Key in the request headers. The standard header name isX-AGENTPAY-API-KEY
.
Using mcp.json
If you are using an MCP Client like Claude or Cursor that uses an mcp.json
configuration file, you would add the header there. Here’s an example snippet for a remote MCP Server:
- Replace
mcp-server-name
with a name you want to use for this tool in your client. - Replace
<MCP_SERVER_URL>
with the MCP server’s endpoint URL (found in the Server’s metadata on the AgentPay Hub). - Replace
YOUR_USER_API_KEY_HERE
with your actual User API Key.
Configuration Details
Let’s break down the key components of the configuration:- Server Name: Choose a descriptive name for your MCP Server configuration.
- Command: Uses
npx
to run themcp-remote
package. - Arguments:
-y
: Automatically answers “yes” to any prompts.mcp-remote
: The package name.<MCP_SERVER_URL>
: The Server’s endpoint URL.--header
: Specifies the API Key header.X-AGENTPAY-API-KEY:YOUR_USER_API_KEY_HERE
: Your authentication header.--allow-http
: Required for local development without HTTPS.
Testing Your Configuration
After configuring your client:- Save your
mcp.json
file. - Restart your MCP Client if necessary.
- Try making a request to the MCP Server.
- Check the “My API Keys” tab in the AgentPay Hub to verify the usage is being recorded.
Troubleshooting
If you encounter issues:- Invalid API Key: Ensure you’ve copied the API Key correctly from the AgentPay Hub.
- Connection Errors: Verify the Server URL is correct and accessible.
- Usage Not Recorded: Check your API Key status in the “My API Keys” tab.