Skip to Content
๐Ÿš€ OpenGame Playable Ads SAAS โ€” AI-generated playable ads from $9/creative
User GuideFeaturesMCP

Connect OpenGame to tools via MCP

OpenGame can connect to external tools and data sources through the Model Context Protocol (MCP)ย . MCP servers give OpenGame access to your tools, databases, and APIs.

What you can do with MCP

With MCP servers connected, you can ask OpenGame to:

  • Work with files and repos (read/search/write, depending on the tools you enable)
  • Query databases (schema inspection, queries, reporting)
  • Integrate internal services (wrap your APIs as MCP tools)
  • Automate workflows (repeatable tasks exposed as tools/prompts)
Tip

If youโ€™re looking for the โ€œone command to get startedโ€, jump to Quick start.

Quick start

OpenGame loads MCP servers from mcpServers in your settings.json. You can configure servers either:

  • By editing settings.json directly
  • By using opengame mcp commands (see CLI reference)

Add your first server

  1. Add a server (example: remote HTTP MCP server):
opengame mcp add --transport http my-server http://localhost:3000/mcp
  1. Verify it shows up:
opengame mcp list
  1. Restart OpenGame in the same project (or start it if it wasnโ€™t running yet), then ask the model to use tools from that server.

Where configuration is stored (scopes)

Most users only need these two scopes:

  • Project scope (default): .qwen/settings.json in your project root
  • User scope: ~/.qwen/settings.json across all projects on your machine

Write to user scope:

opengame mcp add --scope user --transport http my-server http://localhost:3000/mcp
Tip

For advanced configuration layers (system defaults/system settings and precedence rules), see Settings.

Configure servers

Choose a transport

TransportWhen to useJSON field(s)
httpRecommended for remote services; works well for cloud MCP servershttpUrl (+ optional headers)
sseLegacy/deprecated servers that only support Server-Sent Eventsurl (+ optional headers)
stdioLocal process (scripts, CLIs, Docker) on your machinecommand, args (+ optional cwd, env)
Note

If a server supports both, prefer HTTP over SSE.

Configure via settings.json vs opengame mcp add

Both approaches produce the same mcpServers entries in your settings.jsonโ€”use whichever you prefer.

Stdio server (local process)

JSON (.qwen/settings.json):

{ "mcpServers": { "pythonTools": { "command": "python", "args": ["-m", "my_mcp_server", "--port", "8080"], "cwd": "./mcp-servers/python", "env": { "DATABASE_URL": "$DB_CONNECTION_STRING", "API_KEY": "${EXTERNAL_API_KEY}" }, "timeout": 15000 } } }

CLI (writes to project scope by default):

opengame mcp add pythonTools -e DATABASE_URL=$DB_CONNECTION_STRING -e API_KEY=$EXTERNAL_API_KEY \ --timeout 15000 python -m my_mcp_server --port 8080

HTTP server (remote streamable HTTP)

JSON:

{ "mcpServers": { "httpServerWithAuth": { "httpUrl": "http://localhost:3000/mcp", "headers": { "Authorization": "Bearer your-api-token" }, "timeout": 5000 } } }

CLI:

opengame mcp add --transport http httpServerWithAuth http://localhost:3000/mcp \ --header "Authorization: Bearer your-api-token" --timeout 5000

SSE server (remote Server-Sent Events)

JSON:

{ "mcpServers": { "sseServer": { "url": "http://localhost:8080/sse", "timeout": 30000 } } }

CLI:

opengame mcp add --transport sse sseServer http://localhost:8080/sse --timeout 30000

Safety and control

Trust (skip confirmations)

  • Server trust (trust: true): bypasses confirmation prompts for that server (use sparingly).

Tool filtering (allow/deny tools per server)

Use includeTools / excludeTools to restrict tools exposed by a server (from OpenGameโ€™s perspective).

Example: include only a few tools:

{ "mcpServers": { "filteredServer": { "command": "python", "args": ["-m", "my_mcp_server"], "includeTools": ["safe_tool", "file_reader", "data_processor"], "timeout": 30000 } } }

Global allow/deny lists

The mcp object in your settings.json defines global rules for all MCP servers:

  • mcp.allowed: allow-list of MCP server names (keys in mcpServers)
  • mcp.excluded: deny-list of MCP server names

Example:

{ "mcp": { "allowed": ["my-trusted-server"], "excluded": ["experimental-server"] } }

Troubleshooting

  • Server shows โ€œDisconnectedโ€ in opengame mcp list: verify the URL/command is correct, then increase timeout.
  • Stdio server fails to start: use an absolute command path, and double-check cwd/env.
  • Environment variables in JSON donโ€™t resolve: ensure they exist in the environment where OpenGame runs (shell vs GUI app environments can differ).

Reference

settings.json structure

Server-specific configuration (mcpServers)

Add an mcpServers object to your settings.json file:

// ... file contains other config objects { "mcpServers": { "serverName": { "command": "path/to/server", "args": ["--arg1", "value1"], "env": { "API_KEY": "$MY_API_TOKEN" }, "cwd": "./server-directory", "timeout": 30000, "trust": false } } }

Configuration properties:

Required (one of the following):

PropertyDescription
commandPath to the executable for Stdio transport
urlSSE endpoint URL (e.g., "http://localhost:8080/sse")
httpUrlHTTP streaming endpoint URL

Optional:

PropertyType/DefaultDescription
argsarrayCommand-line arguments for Stdio transport
headersobjectCustom HTTP headers when using url or httpUrl
envobjectEnvironment variables for the server process. Values can reference environment variables using $VAR_NAME or ${VAR_NAME} syntax
cwdstringWorking directory for Stdio transport
timeoutnumber
(default: 600,000)
Request timeout in milliseconds (default: 600,000ms = 10 minutes)
trustboolean
(default: false)
When true, bypasses all tool call confirmations for this server (default: false)
includeToolsarrayList of tool names to include from this MCP server. When specified, only the tools listed here will be available from this server (allowlist behavior). If not specified, all tools from the server are enabled by default.
excludeToolsarrayList of tool names to exclude from this MCP server. Tools listed here will not be available to the model, even if they are exposed by the server.
Note: excludeTools takes precedence over includeTools - if a tool is in both lists, it will be excluded.
targetAudiencestringThe OAuth Client ID allowlisted on the IAP-protected application you are trying to access. Used with authProviderType: 'service_account_impersonation'.
targetServiceAccountstringThe email address of the Google Cloud Service Account to impersonate. Used with authProviderType: 'service_account_impersonation'.

Manage MCP servers with opengame mcp

You can always configure MCP servers by manually editing settings.json, but the CLI is usually faster.

Adding a server (opengame mcp add)

opengame mcp add [options] <name> <commandOrUrl> [args...]
Argument/OptionDescriptionDefaultExample
<name>A unique name for the server.โ€”example-server
<commandOrUrl>The command to execute (for stdio) or the URL (for http/sse).โ€”/usr/bin/python or http://localhost:8
[args...]Optional arguments for a stdio command.โ€”--port 5000
-s, --scopeConfiguration scope (user or project).project-s user
-t, --transportTransport type (stdio, sse, http).stdio-t sse
-e, --envSet environment variables.โ€”-e KEY=value
-H, --headerSet HTTP headers for SSE and HTTP transports.โ€”-H "X-Api-Key: abc123"
--timeoutSet connection timeout in milliseconds.โ€”--timeout 30000
--trustTrust the server (bypass all tool call confirmation prompts).โ€” (false)--trust
--descriptionSet the description for the server.โ€”--description "Local tools"
--include-toolsA comma-separated list of tools to include.all tools included--include-tools mytool,othertool
--exclude-toolsA comma-separated list of tools to exclude.none--exclude-tools mytool

Listing servers (opengame mcp list)

opengame mcp list

Removing a server (opengame mcp remove)

opengame mcp remove <name>