Before making your MCP Server publicly available, we makes it easy to test your AgentPay integration to ensure that it is working properly. This guide will walk you through the testing process.

Platform Setup

  1. Ensure Development Mode
    • Your server should still be in “Hidden” mode in the AgentPay Hub.
    • This allows you to test without making your server publicly discoverable.
    • You can verify this in the “My Servers” section of the AgentPay Hub.
  2. Get Your Test API Key
    • Navigate to “My Servers” in the AgentPay Hub.
    • Find your server in the list.
    • Click to generate a test API key.
    • You’ll receive $1.00 in free credits for testing purposes.

Development Setup

  1. Run Your Server
    • Start your MCP server locally or in your development environment.
    • Ensure your server is properly configured with your Service Token.
    • Verify that your server is accessible at its configured endpoint.
  2. Configure Your MCP Client
    • Set up your MCP client (like Cursor or Claude) to connect to your server.
    • Create or modify your mcp.json configuration:
    {
      "mcpServers": {
        "my-test-server": {
          "command": "npx",
          "args": [
            "-y",
            "mcp-remote",
            "YOUR_SERVER_URL",
            "--header",
            "X-AGENTPAY-API-KEY:YOUR_TEST_API_KEY",
            "--allow-http" // Required for local development without HTTPS
          ],
          "env": {}
        }
      }
    }
    
    For detailed configuration instructions, see our Configuring MCP Client guide.
  3. Use the MCP-Remote CLI Debugger
    npx -p mcp-remote@latest mcp-remote-client YOUR_SERVER_URL
    
    This will:
    • Run through the entire authorization flow.
    • Attempt to list available tools & resources.
    • Provide detailed logs for debugging.

Testing Process

  1. Basic Connectivity
    • Verify your MCP Client can connect to your MCP Server.
    • Check that the API key is being properly transmitted.
    • Confirm your server can extract and validate the API key.
  2. Usage Tracking
    • Make some test requests to your server.
    • Check the “My API Keys” section in AgentPay Hub.
    • Verify that usage is being properly recorded.
    • Confirm the free credits are being consumed as expected.
  3. Error Handling
    • Test with invalid API keys.
    • Verify proper error responses.
    • Check error logging and monitoring.

Troubleshooting

If you encounter issues:
  1. Check Server Logs
    • Review your server’s application logs.
    • Look for any authentication or validation errors.
  2. Verify Configuration
    • Double-check your Service Token configuration.
    • Confirm API key header is properly set.
    • Ensure server URL is correct and accessible.
  3. Clear Cached Credentials If using mcp-remote, you can clear cached credentials:
    rm -rf ~/.mcp-auth
    

Next Steps

Once you’ve completed testing and everything is working as expected:
  1. Review your server’s configuration in the AgentPay Hub.
  2. Update any server details or pricing information.
  3. When ready, toggle your server from “Hidden” to “Active” to make it publicly available.
For more information on server registration and configuration, see our Server Registration guide.