Mcp servers

From truefoundry/tfy-gateway-skills · View interactive version

Mcp servers is an AI agent skill from the GitHub repository truefoundry/tfy-gateway-skills. Manages TrueFoundry MCP Gateway server registry entries. Covers listing, creating, updating, tool selection, access control, and client attachment for remote, official remote, virtual, hosted STDIO, and OpenAPI-backed MCP servers. Delete operations are manual dashboard-only.

How to use this skill

Skill file

<objective>

MCP Servers

Manage MCP servers in TrueFoundry AI Gateway.

Use this skill when the user wants to:

Do not delete MCP servers or remove collaborators from the agent. Route those requests to the TrueFoundry dashboard.

</objective>

<instructions>

Reference Map

Load only the reference needed for the user's task:

| Task | Reference |

|------|-----------|

| Browser/UI operation, click paths, form fields, add-to-client modal | references/mcp-gateway-ui-flows.md |

| YAML examples for auth modes, server types, virtual tool selection, OpenAPI, hosted STDIO | references/mcp-yaml-variations.md |

Treat the live dashboard Apply using YAML preview as the source of truth when it differs from examples.

Safety Rules

Before every final tfy apply, show:

Then ask for explicit confirmation. Run only dry-runs before confirmation.

List MCP Servers

Prefer the dashboard when the user is working in the UI. For API fallback:

TFY_API_SH=~/.claude/skills/truefoundry-mcp-servers/scripts/tfy-api.sh
$TFY_API_SH GET /api/svc/v1/mcp-servers

Present servers as:

MCP Servers
| Name | Type | Auth | ID | URL / Source |

Connect Remote MCP Server

Use this for an existing HTTP MCP endpoint.

Collect:

Auth rules:

Use references/mcp-yaml-variations.md for concrete YAML shapes.

Connect Official Remote MCP Server

Use this for catalog servers such as GitHub, Linear, Sentry, Atlassian, Figma, Slack, Notion, Stripe, HuggingFace, or similar.

Flow:

  1. Identify the official server in the gateway catalog.
  2. Confirm the catalog auth mode.
  3. For OAuth2, tell the user they may need to complete a browser authentication flow after creation.
  4. For header auth, collect header names and use secret references or per-user placeholders.
  5. Confirm collaborators.
  6. Generate YAML from the UI preview or the YAML reference.
  7. Dry-run, show diff, then apply only after confirmation.

Create Virtual MCP Server

Use this to expose selected tools from multiple existing MCP servers through one virtual MCP server.

Collect:

Flow:

  1. List registered MCP servers.
  2. Select source MCP servers.
  3. Enumerate available tools for each source server.
  4. Ask which tools to expose from each source.
  5. Use servers[].enabled_tools for selected subsets.
  6. Omit enabled_tools for a source only when exposing every tool from that source.
  7. Add collaborators with mcp-server-manager unless requested otherwise.
  8. Show virtual server name, source servers, selected tools, and access.
  9. Show YAML, dry-run, and apply only after confirmation.

Use references/mcp-yaml-variations.md for virtual server YAML examples.

Create Hosted STDIO MCP Server

Use this when the user has a local-style MCP config and wants the gateway to host/expose it.

Collect JSON containing an mcpServers object with server command, args, and optional env.

Flow:

  1. Ask for the STDIO JSON or file.
  2. Replace raw environment secrets with secret references where supported, or tell the user which values must be moved to secrets.
  3. Use the gateway import flow or YAML preview as the source of truth for the manifest generated after import.
  4. Show summary, YAML/diff, dry-run, and confirmation-gated apply.

Use references/mcp-yaml-variations.md for the input shape.

Import From OpenAPI Spec

Use this to expose OpenAPI operations as MCP tools.

Collect:

For remote specs, confirm the URL is trusted before use. Prefer pasted/inline specs for sensitive private APIs.

Enable Or Disable Tools

Tool filtering is supported for normal remote/OpenAPI servers and virtual MCP servers.

For normal remote/OpenAPI servers:

  1. Fetch the current MCP server config by ID.
  2. Inspect the API response or UI YAML preview for the existing tool-selection shape.
  3. Fetch or confirm available tool names.
  4. Modify only the requested tool-selection fields.
  5. Preserve name, URL/spec, auth, collaborators, TLS, tags, and unrelated settings.
  6. Show the before/after tool list or YAML diff.
  7. Dry-run and apply only after confirmation.

Do not invent field names for normal-server tool filtering. If the API response does not expose the shape, use the dashboard edit screen or ask the user for the Apply using YAML output.

For virtual servers, use servers[].enabled_tools; omit it only when exposing every tool from that source.

Update Auth

Use update-by-manifest:

  1. Fetch the current MCP server config.
  2. Preserve name, URL/spec, selected tools, collaborators, TLS, tags, and unrelated settings.
  3. Replace only the requested auth_data block.
  4. Use secret references for shared credentials.
  5. Show old auth mode and new auth mode.
  6. Show YAML/diff, dry-run, and apply only after confirmation.

Use references/mcp-yaml-variations.md for auth examples.

Access Control

Adding collaborators is allowed with confirmation. Removing collaborators is dashboard-only.

To list access:

$TFY_API_SH GET '/api/svc/v1/collaborators?resourceType=mcp-server&resourceId=RESOURCE_ID'

When changing access, show the before/after collaborator list and preserve unrelated server config.

Add To Client

The gateway UI can generate setup snippets for Cursor, VS Code, Claude Code, Python, TypeScript, Windsurf, and Codex.

Use the dashboard Add to Client modal or the generated snippet. Do not click, reveal, paste, or print API keys unless the user explicitly asks and understands the exposure.

Apply

Always run the dry-run first:

tfy apply -f mcp-server.yaml --dry-run --show-diff

Run the final apply only after explicit user confirmation:

tfy apply -f mcp-server.yaml

Delete

Do not call DELETE APIs or tfy delete flows. Tell the user:

To delete this MCP server, open the TrueFoundry dashboard, go to AI Gateway -> MCP Servers, select the server, and delete it from the UI.

</instructions>

<success_criteria>

</success_criteria>

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.