MCP Plugins
This guide covers advanced MCP topics: OAuth-based integrations, programmatic MCP management, and configuration patterns.
For basic MCP concepts, see What Are MCP Servers?. For installation, see Installing MCP Servers.
OAuth MCP Integrations
Some MCP servers require OAuth authentication to access user data (e.g., Google Analytics, Google Search Console, Slack).
How OAuth MCPs Work
- You install the MCP on a Space
- The web app shows a Connect button
- You authenticate with the external service via OAuth
- Tokens are stored securely and refreshed automatically
Supported OAuth Integrations
| Integration | What It Provides |
|---|---|
| Google Analytics | GA4 traffic data, page metrics, user behavior |
| Google Search Console | Search impressions, clicks, CTR, keyword positions |
Token Lifecycle
- OAuth tokens are stored encrypted per-Space
- Access tokens are refreshed automatically before expiration
- If refresh fails, the agent can request re-authentication:
{
"action": "requestReauth",
"target": "google-analytics"
}
This triggers a UI prompt for the user to reconnect.
MCP Configuration via API
Create MCP Instance
curl -X POST "https://us.teamday.ai/api/v1/mcps" \
-H "Authorization: Bearer $TEAMDAY_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "custom-api",
"type": "stdio",
"command": "node",
"args": ["dist/index.js"],
"env": {
"API_KEY": "your-api-key"
}
}'
Update MCP Configuration
curl -X PATCH "https://us.teamday.ai/api/v1/mcps/<id>" \
-H "Authorization: Bearer $TEAMDAY_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"env": {
"API_KEY": "new-api-key"
}
}'
In-Chat Management
Using the TeamdayAdmin tool:
// Browse available MCPs
{"action": "browseMcpRegistry"}
// Create a new MCP instance
{
"action": "createMcp",
"data": {
"name": "my-tool",
"type": "stdio",
"command": "npx",
"args": ["-y", "@org/mcp-server"],
"env": {"API_KEY": "abc123"}
}
}
Configuration Patterns
Environment Variable References
In .mcp.json, reference Space secrets with ${VAR_NAME}:
{
"mcpServers": {
"database": {
"command": "npx",
"args": ["-y", "@anthropic-ai/mcp-postgres", "${DATABASE_URL}"]
},
"api-tool": {
"command": "node",
"args": ["tools/api/index.js"],
"env": {
"API_KEY": "${API_KEY}",
"API_SECRET": "${API_SECRET}"
}
}
}
}
Store the actual values as secrets:
teamday spaces set-secret <space-id> \
DATABASE_URL=postgres://user:pass@host/db \
API_KEY=abc123 \
API_SECRET=xyz789
Multiple MCP Servers
A Space can have many MCP servers. Each runs as a separate process:
{
"mcpServers": {
"google-analytics": {
"command": "npx",
"args": ["-y", "@anthropic-ai/mcp-google-analytics"],
"env": {"GA_PROPERTY_ID": "${GA_PROPERTY_ID}"}
},
"postgres": {
"command": "npx",
"args": ["-y", "@anthropic-ai/mcp-postgres", "${DATABASE_URL}"]
},
"github": {
"command": "npx",
"args": ["-y", "@anthropic-ai/mcp-github"],
"env": {"GITHUB_TOKEN": "${GITHUB_TOKEN}"}
}
}
}
Disabling Tools
If an MCP provides tools you don't want agents to use, disable them at the Space level:
curl -X PATCH "https://us.teamday.ai/api/v1/spaces/<space-id>" \
-H "Authorization: Bearer $TEAMDAY_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"disabledTools": ["mcp__github__create_issue"]}'
Programmatic vs File-Based
| Approach | How | Best For |
|---|---|---|
| API/CLI | teamday mcps create | Org-wide MCP instances, managed centrally |
| .mcp.json | File in Space root | Per-Space configuration, version controlled |
| TeamdayAdmin | In-chat tool call | Agent-driven setup during conversations |
Programmatic MCPs (via API) override file-based MCPs with the same name.
Next Steps
- MCP Servers — MCP concepts
- Installing MCP Servers — Installation guide
- Creating Custom MCP Servers — Build your own
- Tools Overview — All tool categories