# Connect your AI to Madely (test mode)

> Copy-paste setup for ChatGPT, Claude, Claude Code, Grok, Cursor, VS Code and any MCP client. MCP endpoint: https://api.madely.ai/mcp. Config formats below were checked against vendor docs on 2026-12-02; vendors change them, so follow the linked source if a step does not match.

Get a free test key with POST /v1/sandbox/keys (no signup). If your client cannot send headers, connect with no auth: the MCP endpoint then mints a sandbox key for you, so every tool still works in test mode.

## ChatGPT (web)

1. Open ChatGPT on the web, go to Plugins, press the plus button and choose Add custom MCP server.
2. Name: Madely. Server URL: https://api.madely.ai/mcp. Authentication: No authentication (test mode mints a sandbox key) or paste nothing else.
3. Review the risk notice, then Create as a plugin and install it.
4. In a chat type @ and pick Madely, then ask: "Find a mug and quote 24 to Denver, ZIP 80202."

ChatGPT accepts SSE and streaming HTTP, and treats tools without readOnlyHint as write actions that need confirmation. Madely marks its read-only tools, so lookups run without prompts.

Sources: [OpenAI: Add custom MCP server](https://platform.openai.com/docs/guides/developer-mode)

## Claude (claude.ai and Claude Desktop)

1. Open Customize, then Connectors, and add a custom connector.
2. Enter https://api.madely.ai/mcp as the server URL. Claude connects from Anthropic's cloud, so the URL must be public HTTPS on port 443.
3. Enable the Madely connector in a chat and turn off any tools you do not want used.

Remote connectors are brokered by your Claude account even in Claude Desktop. claude_desktop_config.json is for local servers only.

Sources: [Claude Help: custom connectors with remote MCP](https://support.claude.com/en/articles/11175166-get-started-with-custom-connectors-using-remote-mcp)

## Claude Code

1. Run the command below in your terminal (user scope keeps it available in every project).
2. Run claude mcp list to confirm it is connected, then ask Claude Code to use Madely.

Terminal:

```bash
claude mcp add --transport http madely https://api.madely.ai/mcp
# with a sandbox key:
claude mcp add --transport http madely https://api.madely.ai/mcp --header "Authorization: Bearer $MADELY_API_KEY"
```

.mcp.json (project scope):

```json
{
  "mcpServers": {
    "madely": {
      "type": "http",
      "url": "https://api.madely.ai/mcp",
      "headers": {
        "Authorization": "Bearer ${MADELY_API_KEY}"
      }
    }
  }
}
```

Sources: [Claude Code: connect to tools via MCP](https://docs.claude.com/en/docs/claude-code/mcp)

## Grok (xAI API remote MCP tool)

1. In an xAI Responses API request add Madely to the tools array.
2. Optionally set allowed_tools to the read-only tools first (list_products, get_print_spec, validate_print_file, get_quote).

For the consumer Grok app, add a custom connector from the connectors page (see /connect). The API form below is the one verified against xAI developer docs.

curl:

```bash
curl https://api.x.ai/v1/responses \
  -H "Content-Type: application/json" -H "Authorization: Bearer $XAI_API_KEY" \
  -d '{"model":"<current Grok model>","input":"Quote 24 mugs to ZIP 80202 with Madely.","tools":[{"type":"mcp","server_url":"https://api.madely.ai/mcp","server_label":"madely","allowed_tools":["list_products","get_quote"]}]}'
```

Sources: [xAI: Remote MCP tools](https://docs.x.ai/docs/guides/tools/remote-mcp-tools)

## Cursor

1. Create ~/.cursor/mcp.json (all projects) or .cursor/mcp.json (one project).
2. Put the key in an environment variable and reference it with ${env:NAME}; restart Cursor.

mcp.json:

```json
{
  "mcpServers": {
    "madely": {
      "url": "https://api.madely.ai/mcp",
      "headers": {
        "Authorization": "Bearer ${env:MADELY_API_KEY}"
      }
    }
  }
}
```

Sources: [Cursor: Model Context Protocol (MCP)](https://cursor.com/docs/mcp); [Cursor Help: MCP integrations](https://cursor.com/help/customization/mcp)

## VS Code (GitHub Copilot)

1. Run Chat: Open Customizations, choose MCP Servers, Add Server, HTTP, and enter the URL; or edit the file below.
2. Verify with a low-impact call such as list_products and expand the tool call to confirm Madely answered.

The Copilot harness reads a top-level mcpServers object from ~/.copilot/mcp-config.json (personal) or .mcp.json at the workspace root. The older editor-managed .vscode/mcp.json uses a "servers" object; VS Code docs say that Local harness is deprecated and will be removed in February 2027.

.mcp.json (Copilot harness):

```json
{
  "mcpServers": {
    "madely": {
      "type": "http",
      "url": "https://api.madely.ai/mcp",
      "headers": {
        "Authorization": "Bearer ${MADELY_API_KEY}"
      }
    }
  }
}
```

.vscode/mcp.json (legacy Local harness):

```json
{
  "servers": {
    "madely": {
      "type": "http",
      "url": "https://api.madely.ai/mcp"
    }
  }
}
```

Sources: [VS Code: Add and use MCP servers](https://code.visualstudio.com/docs/agent-customization/mcp-servers); [VS Code: MCP configuration reference](https://code.visualstudio.com/docs/agents/reference/mcp-configuration)

## Any other MCP client

1. Transport: streamable HTTP. URL: https://api.madely.ai/mcp. Methods: initialize, tools/list, tools/call, ping. GET returns 405.
2. Auth (optional in test mode): Authorization: Bearer <sandbox key> or x-api-key: <sandbox key>.
3. Discovery: /.well-known/mcp.json, /.well-known/api-catalog, /openapi.json, /llms.txt.

Smoke test:

```bash
curl -s https://api.madely.ai/mcp -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
```

Portable mcpServers JSON:

```json
{
  "mcpServers": {
    "madely": {
      "url": "https://api.madely.ai/mcp"
    }
  }
}
```

Sources: [MCP specification: transports](https://modelcontextprotocol.io/specification/2025-06-18/basic/transports)

## Next

- [Quickstart (curl, Python, TypeScript)](https://api.madely.ai/quickstart)
- [Full guide](https://api.madely.ai/llms-full.txt)
- [OpenAPI](https://api.madely.ai/openapi.json)
