MCPs Guide
Model Context Protocol (MCP) connections let agents call external services while keeping credentials and transport details centralized. Use this guide when you need to create, manage, or validate MCP configurations across REST, the Python SDK, and the CLI.
Create an MCP Configuration
When to use: Establish a new integration endpoint or clone settings from staging to production.
from glaip_sdk import Client
client = Client()
mcp = client.mcps.create_mcp(
name="weather-service",
description="HTTP weather API via MCP",
transport="http",
config={"url": "https://weather.example.com/mcp"},
authentication={
"type": "api-key",
"key": "X-API-Key",
"value": "secret-key",
},
)
print(mcp.id)aip mcps create \
--name weather-service \
--description "HTTP weather API via MCP" \
--transport http \
--config '{"url": "https://weather.example.com/mcp"}' \
--authentication '{"type": "api-key", "key": "X-API-Key", "value": "secret-key"}'Using file references:
aip mcps create \
--name weather-service \
--transport http \
--config @weather-config.json \
--auth @weather-auth.jsonSee Using files with the CLI for file-based workflows and import examples.
See Using files with the CLI for field details and override behaviour.
The CLI loads every supported field from the file, then applies any CLI flags you pass on top of that data. This lets you tweak a few values (for example a new name or transport) without editing the file:
Merge rules:
Values inside
weather-mcp.jsonform the baseline request (name, transport, config, authentication, metadata, etc.).Flags you provide alongside
--importoverride the file values one by one (e.g.,--transport httpreplaces the file’s transport).If the file already supplies required fields like
nameandtransport, you can omit those flags entirely; the CLI falls back to the file contents.
Example weather-mcp.json:
Using files with the CLI
Inline vs file inputs: Any JSON flag (e.g.,
--config,--auth) accepts either inline JSON or a file reference using@path/to/file.json. File inputs are parsed with the same validation as inline payloads.Importing full definitions: Supply
--import <file>to recreate an MCP from an export. The CLI loads every supported field from the file (name, transport, config, authentication,mcp_metadata, etc.).Flag overrides: CLI flags provided alongside
--importoverride the matching keys in the file. Leaving a flag out keeps the file’s value. When the file already contains required fields likenameandtransport, those flags become optional.
Example config file:
Example auth file:
Example import file:
Command examples:
Rotate Credentials or Update Configs
When to use: Refresh secrets before they expire or tweak transport parameters without downtime.
Validate Connections Before Saving
When to use: Confirm the connector responds and auth works before exposing it to agents.
Test connectivity without persisting a record:
Common errors and fixes
401 Unauthorized when validating
API key lacks MCP permissions or connector secrets expired.
Issue a runner/creator key or rotate the provider secret under Rotate Credentials.
404 or connection refused during validation
Base URL incorrect or firewall blocking outbound traffic.
Confirm the URL, allowlist the host, or test from a network that can reach the provider.
Connector saves but tools list is empty
Provider exposes no MCP tools or scope is limited.
Run discovery with elevated scopes or confirm the provider exports MCP metadata.
Agents timeout when calling the MCP
Runtime overrides missing, or concurrency exceeds provider limits.
Use per-run overrides for busy periods and tune agent timeout settings.
Discover MCP Tools
When to use: Inspect which tool definitions become available once the connector is active.
Attach discovered tool IDs to agents just like native or custom uploads.
Runtime Overrides During Agent Runs
When to use: Supply per-run credentials or endpoints that differ from the stored defaults.
MCP Maintenance
When to use: Audit or retire connectors after incidents, vendor changes, or environment migrations.
Soft delete via
DELETE /mcps/{id}.List MCPs with
GET /mcpsoraip mcps list.Combine MCP tooling with the Tools guide when you want to import remote tools into agent definitions.
Best Practices
When to use: Align your organisation on safe defaults that reduce downtime and credential leaks.
Related Documentation
Tools guide — attach native, custom, and MCP-discovered tools.
Agents guide — manage agent lifecycle and runtime overrides.
Automation & scripting — script MCP promotion in CI pipelines.