FluxyChat

How-to Guides

MCP Client Integration

FluxyChat's MCP client lets AI agents consume tools and resources from any MCP-compatible server, expanding agent capabilities without custom integrations.

MCP Client Integration

FluxyChat's MCP (Model Context Protocol) client lets AI agents consume tools and resources from any MCP-compatible server, expanding agent capabilities without writing custom integrations.

Overview

MCP is the de-facto protocol for AI↔app communication, adopted by OpenAI, Google, Microsoft, and Anthropic (~97M SDK downloads/month). FluxyChat ships an MCP client today so agents can call external tools. To expose a room to external agents, use the room as MCP server guide (POST /mcp/rooms/:roomId).

Supported Transports

TransportUse case
HTTPRemote MCP servers (production)
SSEServer-Sent Events streaming
stdioLocal development, CLI tools

Connecting to an MCP Server

import { createMcpClient } from "@fluxy-chat/sdk";

const mcp = createMcpClient({
  transport: "http",
  url: "https://mcp.example.com/sse",
  // or stdio: { command: "npx", args: ["-y", "@modelcontextprotocol/server-git"] }
});

// List available tools
const tools = await mcp.listTools();
// [{ name: "git_status", description: "...", inputSchema: {...} }, ...]

// List resources
const resources = await mcp.listResources();

Tool conversion

MCP tools are auto-converted to FluxyChat tool definitions, ready for LLM function calling:

import { convertMcpTools } from "@fluxy-chat/sdk";

const mcpTools = await mcp.listTools();
const fluxyTools = convertMcpTools(mcpTools);
// Each MCP tool becomes a FluxyChat tool with execute(), description, inputSchema

// Use with agent
const agent = createAgent({
  model: "gpt-4o",
  tools: [...fluxyTools, ...builtInTools],
});

Resources

MCP resources provide application-driven data that's passed as context to the LLM:

const resources = await mcp.listResources();

// Resources can be:
// - File contents (e.g., "file:///repo/README.md")
// - Database queries (e.g., "postgres://.../query/users")
// - API responses (e.g., "https://api.github.com/repos/...")

for (const resource of resources) {
  const content = await mcp.readResource(resource.uri);
  // Inject as context in the agent's system prompt
}

Configuration

MCP servers are configured per-project via the admin API:

# Register an MCP server
curl -X POST "$WORKER_URL/admin/mcp-servers" \
  -H "Authorization: Bearer $ADMIN_JWT" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "github",
    "transport": "http",
    "url": "https://mcp.github.com/sse",
    "toolFilter": ["git_status", "git_diff", "create_issue"]
  }'

MCP Apps

MCP Apps render sandboxed iframes for tool UIs, letting tools show interactive interfaces inside the chat:

  • Model-visible tools: AI calls them and reads results
  • App-only tools: UI renders for humans, AI doesn't see them
  • Sandboxed: Iframe isolation prevents unauthorized access

Security

  • MCP server URLs are validated against an allowlist
  • Tool execution respects FluxyChat's approval gates
  • Resource content is filtered through the DLP pipeline before reaching the LLM
  • Per-project tool filtering (toolFilter) limits which MCP tools are exposed

Common MCP Servers

ServerTools
@modelcontextprotocol/server-gitGit status, diff, log, commit
@modelcontextprotocol/server-githubIssues, PRs, search
@modelcontextprotocol/server-filesystemFile read/write/search
@modelcontextprotocol/server-postgresSQL queries
@modelcontextprotocol/server-brave-searchWeb search

See Also

On this page