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

  1. You install the MCP on a Space
  2. The web app shows a Connect button
  3. You authenticate with the external service via OAuth
  4. Tokens are stored securely and refreshed automatically

Supported OAuth Integrations

IntegrationWhat It Provides
Google AnalyticsGA4 traffic data, page metrics, user behavior
Google Search ConsoleSearch 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

ApproachHowBest For
API/CLIteamday mcps createOrg-wide MCP instances, managed centrally
.mcp.jsonFile in Space rootPer-Space configuration, version controlled
TeamdayAdminIn-chat tool callAgent-driven setup during conversations

Programmatic MCPs (via API) override file-based MCPs with the same name.


Next Steps