QVeris
QVerisHow-to Guide

MCP Integration Guide: Connect AI Agents to Tools

A production-focused MCP integration guide covering architecture, local and remote transports, configuration, SDK implementation, authorization, validation, and failure handling.

TL;DR
  • Problem: A config can launch an MCP server while authorization, schema compatibility, tool safety, and failure handling remain untested.
  • Solution: Select local stdio or remote Streamable HTTP from the trust boundary, then validate initialization, capability discovery, tool calls, and observability layer by layer.
  • Result: You finish with an integration contract: pinned components, scoped credentials, known schemas, approval rules, test evidence, timeouts, logs, and a rollback path.
MCP integration lifecycle from transport selection through contract monitoring
MCP integration is a lifecycle: discovery, schema inspection, safe calls, output validation, and versioned monitoring all matter.

What Is MCP Integration and What Must Work?

MCP integration connects an AI host to one or more MCP servers through a dedicated client connection. A complete integration must initialize the protocol, negotiate capabilities, discover typed tools or resources, authorize access, execute calls, validate results, and handle lifecycle failures—not merely start a server process.

MCP is an open protocol for connecting AI applications to external systems. Its official architecture separates the host, one dedicated client connection per server, the server, the JSON-RPC data layer, and the transport layer (Source: MCP architecture overview). The official SDKs implement protocol behavior across supported languages, while the debugging guide explains how to inspect lifecycle and transport failures.

MCP standardizes the connection and capability contract; it does not decide which tools an agent should trust, when a model may call them, or whether returned data is correct. Pair protocol integration with human approval for high-impact actions, result validation, and operational monitoring.

Choose an MCP Integration Path Before You Configure

Choose the path from deployment boundary and trust requirements, not from the client name alone. Decide where the server runs, which transport it exposes, who owns credentials, what actions require approval, and how failures will be observed before editing configuration.

Pin the protocol and SDK versions you actually deploy. The 2026-07-28 specification is a release candidate, not a reason to assume every host and server has upgraded. During initialization, record the negotiated protocol version and capabilities; test the exact client, server, transport, extensions, authorization flow, and rollback path used in production.
固定实际部署的协议和 SDK 版本。 2026-07-28 规范目前是候选版本,不能据此假设所有 Host 和 Server 都已升级。初始化时应记录协商出的协议版本和能力,并测试生产实际使用的客户端、服务器、传输、扩展、授权流程和回滚路径。
Which AI client are you integrating?
Claude Desktop / Cursor
Path 1 or Path 2
Custom AI agent
Path 3 or Path 4
Do you need a prebuilt server or custom functionality?
Prebuilt server exists
Path 1, 2, or 4
Need to build custom
Path 3
Want zero-config or full control?
Managed
Path 4 (Qveris)
Full control
Path 1, 2, or 3
Practical default: Use local stdio for a trusted single-user process, Streamable HTTP for an independently deployed remote service, an official SDK for custom logic, and a managed capability layer only after evaluating provenance, permissions, latency, cost, and failure behavior.

If you haven't selected a server yet, compare 8 popular MCP servers to find one matching your use case.

Path 1: Connect a Local stdio MCP Server

Use this path when one user or workstation launches a trusted local server as a child process. The host starts the command, exchanges JSON-RPC messages over stdin and stdout, and terminates the process when the connection closes.

Deployment: Local process Complexity: Low

Step 1: Find your Claude Desktop config file

Claude Desktop stores local server launch definitions in its application configuration. Treat this file as executable configuration: review the command, package, arguments, working directory, environment variables, and filesystem scope before enabling a server.

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%/Claude/claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

Create the file only when the host documentation requires it, keep valid JSON, and restrict access because environment values may contain secrets. Prefer secret references or the operating system credential store over committed plaintext values.

Step 2: Add your MCP server configuration

Add one server at a time. Pin a reviewed package version where practical, pass only the directories or resources the server needs, and run the launch command manually before asking the host to start it.

{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/dir"]
    }
  }
}

Step 3: Restart Claude Desktop

Restart the host after saving the configuration, then inspect its MCP settings or logs. A listed server proves that the process started; it does not prove every tool is safe or that every call succeeds.

Confirm the host can complete initialization, negotiate capabilities, and list tools. Record the advertised tool names and input schemas so later upgrades can be checked for contract drift.

Adding more servers

Multiple servers increase capability coverage and also increase prompt surface, secret exposure, startup time, and the chance of ambiguous tool selection. Add only the servers needed for the current workspace and disable unused write-capable tools.

{
  "mcpServers": {
    "pulse": {
      "command": "npx",
      "args": ["-y", "@pulsemcp/core"]
    }
  }
}

Verifying your connection

Verify the protocol before testing a natural-language task: confirm initialization succeeds, list tools, inspect each input schema, then call one read-only tool with known arguments and compare the result with the source system.

  • "List the files in my configured directory"
  • "Show me the recent commits in my GitHub repository"
  • "What's the status of my connected services?"

A useful smoke test proves five things separately: the process starts, capability negotiation succeeds, the expected tool is exposed, invalid arguments are rejected, and a valid call returns typed content without leaking secrets.

If the connection fails

Diagnose failures by layer: process launch, transport framing, initialization, schema discovery, authorization, downstream API, and result validation. Preserve request IDs and sanitized stderr logs so a generic host error can be traced to the failing layer.

  • Config file not found: Verify the path matches your OS (see Step 1 above)
  • JSON syntax error: Run your config through a JSON validator — trailing commas and missing quotes are common mistakes
  • Server package not installed: Run npx -y @modelcontextprotocol/server-filesystem manually to verify the package works
  • Permission denied: On macOS, ensure Claude Desktop has file system access in System Settings

Switching between servers

Enable servers per task and keep write-capable tools behind explicit confirmation. Tool descriptions are instructions presented to the model, not a security boundary; enforce scopes, path allowlists, and authorization in code.

IDE hosts often support project and user scopes. Keep portable, non-secret configuration in the project and place credentials in environment variables or approved secret stores; never commit tokens to the repository.

Scope: Project or user Complexity: Low

Step 1: Create the Cursor MCP config directory

In your project root, create a .cursor folder if it doesn't exist. Inside that folder, create mcp.json:

mkdir -p .cursor
touch .cursor/mcp.json

Step 2: Add your MCP server configurations

Edit .cursor/mcp.json to include the servers you want. Here's a configuration that connects both filesystem and GitHub:

{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem", "./project-files"]
    },
    "github": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "your-token-here"
      }
    }
  }
}

Step 3: Restart Cursor

Reload Cursor after changing configuration and inspect the MCP settings panel. Confirm the intended scope is active, the command resolves in Cursor's environment, and no duplicate server name shadows another definition.

Verifying your connection

Start with a read-only, deterministic call. Ask for a known file or repository fact, inspect the proposed tool and arguments before approval, and compare the returned value with the source.

If discovery works but execution fails, separate schema errors from permission errors and downstream failures. Check the host log, server stderr, required environment variables, executable path, and package version.

Other AI IDEs with MCP support

Other MCP-capable IDEs differ in configuration scope, remote-server support, approval UX, and secret handling. Use each host's current documentation instead of assuming every client accepts the same file path or fields.

  • Windsurf: Uses ~/.windsurf/mcp.json for global config or .windsurf/mcp.json for project-local
  • VS Code with Copilot: MCP support is experimental; check the VS Code extensions documentation for setup
  • JetBrains AI Assistant: Configuration varies by IDE version; see JetBrains documentation

The core config format (mcpServers JSON object) is consistent across these tools, so the servers you configure will work similarly.

Path 2: Connect MCP in Cursor and Other IDEs

Use an IDE-scoped integration when tools should follow a repository or development workspace. This improves portability, but shared configuration must remain least-privilege and must not contain user credentials.

Scope: Project or user Complexity: Low

Why use Cursor over Claude Desktop for MCP?

Cursor is useful when MCP calls are part of code navigation, issue investigation, tests, and repository workflows. The important design choice is not the editor brand; it is whether the project may declare tools and how each developer supplies credentials safely.

Define approval rules for destructive actions, keep repository and account scopes narrow, and document which tool results may enter model context. For regulated code or data, confirm retention and remote-processing boundaries before enabling a server.

Step 1: Create the Cursor MCP config directory

In your project root, create a .cursor folder if it doesn't exist. Inside that folder, create mcp.json:

# Create the config directory and file
mkdir -p .cursor
touch .cursor/mcp.json

Step 2: Add your MCP server configurations

Edit .cursor/mcp.json to include the servers you want. Here's a configuration that connects both filesystem and GitHub with proper authentication:

{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem", "./project-files"]
    },
    "github": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "your-token-here"
      }
    }
  }
}

Step 3: Restart Cursor

After reloading the IDE, verify the server identity, advertised capabilities, and exact tool schemas. Do not approve a call solely because its natural-language description sounds correct.

Run a known-answer test, an invalid-input test, a permission-denied test, and a timeout test. These four cases reveal more about production readiness than a single successful demo.

Adding environment-specific configurations

Separate development and production identities rather than swapping files that contain secrets. Use environment-specific secret stores, distinct scopes, and explicit server versions; keep shared project configuration free of credentials.

  • .cursor/mcp.json — development config (includes debugging tools)
  • .cursor/mcp.prod.json — production config (includes monitoring tools)

Make environment selection explicit in the launch command or deployment system, and fail closed when a required secret or endpoint is missing.

Common Cursor MCP use cases

Teams commonly use IDE MCP integrations for repository search, issue context, documentation lookup, test execution, database inspection, and deployment diagnostics. Keep mutation tools separate from read-only discovery whenever possible.

  • Code review automation: Connect GitHub server to automatically fetch PR details and suggest reviews
  • Documentation generation: Connect to internal wikis or Confluence for context-aware doc generation
  • Database queries: Connect to MCP servers that wrap your internal data tools
  • API testing: Connect to HTTP request tools for testing APIs directly in the IDE

Other AI IDEs with MCP support

Support details change quickly across IDEs. Verify the current host documentation for configuration location, transport support, authorization, enterprise policy controls, and user approval behavior.

  • Windsurf: Uses ~/.windsurf/mcp.json for global config or .windsurf/mcp.json for project-local
  • VS Code with Copilot: MCP support is experimental; check the VS Code extensions documentation for setup
  • JetBrains AI Assistant: Configuration varies by IDE version; see JetBrains documentation

The core config format (mcpServers JSON object) is consistent across these tools, so the servers you configure will work similarly.

Path 3: Build an MCP Server with the Official SDK

Build a server when no maintained implementation exposes the exact operations and trust boundary you need. The official SDKs cover clients and servers in TypeScript, Python, C#, Go, and other languages; choose by runtime ownership and deployment constraints.

Ownership: Your team Complexity: Medium

Step 1: Install the FastMCP SDK

Use an official, actively maintained SDK and pin a tested version. Define the server name and version, then implement the smallest tool surface needed for the workflow.

# Python
pip install fastmcp

# TypeScript / Node.js
npm install @modelcontextprotocol/sdk

Step 2: Define your tool handlers

Use typed input schemas, clear descriptions, bounded outputs, explicit error results, and timeouts around downstream calls. Tool annotations help clients present risk but do not replace authorization or server-side validation.

from fastmcp import FastMCP

mcp = FastMCP("my-data-tool")

@mcp.tool()
def analyze_data(query: str, timeframe: str = "7d") -> str:
    """Analyze data from your internal database.

    Args:
        query: The analysis question
        timeframe: Time window (1d, 7d, 30d)
    """
        # Your custom logic here
    results = f"Analysis for {query} over {timeframe}: [data]"
    return results

@mcp.resource("database://schema")
def get_schema():
    return "Table: users | Columns: id, name, email, created_at"

mcp.run()

Step 3: Start your server and connect

For stdio, let the host launch the server and reserve stdout for protocol messages; write diagnostics to stderr. For remote deployment, expose Streamable HTTP, implement the documented authorization flow, and test concurrent clients and reconnection.

# Run your server
python my_server.py

# Add to Claude Desktop config (~/.config/Claude/claude_desktop_config.json)
{
  "mcpServers": {
    "my-data-tool": {
      "command": "python",
      "args": ["/path/to/my_server.py"]
    }
  }
}

When to choose Path 3

Choose a custom server when you need internal business logic, a controlled data boundary, stable schemas, or auditability that a third-party server cannot provide. Budget for dependency updates, protocol compatibility, observability, and incident response.

If a maintained server already fits the required operations and trust boundary, integrate and test it instead of rebuilding. Managed discovery can reduce search effort, but it does not remove the need to inspect schemas and permissions.

For a full comparison of MCP server options including prebuilt servers, see our server guide.

Path 4: Add QVeris as a Managed Capability Layer

Use QVeris as a complementary capability discovery and routing layer when an agent needs to find and inspect many external data or tool capabilities. Keep the distinction clear: MCP defines the connection protocol; QVeris helps discover, inspect, and call capabilities through its supported interfaces.

Time: Varies by host Complexity: Managed

How Qveris differs from manual MCP server setup

Direct MCP integrations usually give each server its own process or endpoint, credentials, scopes, lifecycle, logs, and upgrade policy. That isolation improves control but increases operational work as the server count grows.

  • Filesystem server for file operations
  • GitHub server for repository access
  • Slack server for team communication
  • Database server for data queries
  • ...and so on for each tool you need

A managed capability layer centralizes discovery and invocation patterns. Evaluate it as an additional dependency: verify supported operations, provider provenance, data handling, authentication, quotas, latency, failure behavior, and exit strategy before production use.

Step 1: Install Qveris CLI

Install the documented QVeris CLI package, confirm the package publisher and version, and keep production versions pinned through your normal dependency-management process.

npm install -g @qverisai/cli

# Or use npx without installing
npx -y @qverisai/cli --version

Step 2: Get your API key

Create a QVeris account and obtain credentials from the official dashboard at qveris.ai. Keep keys out of source control, use the narrowest available scope, and rotate any credential exposed in a log, screenshot, or committed file.

Step 3: Add Qveris to your MCP config

Add the documented QVeris MCP server package to the host configuration, then verify the package name and launch command against the current QVeris documentation before deployment.

// Qveris: One config, many capabilities
{
  "mcpServers": {
    "qveris": {
      "command": "npx",
      "args": ["-y", "@qverisai/mcp-server"],
      "env": {
        "QVERIS_API_KEY": "your-api-key"
      }
    }
  }
}

After connection, use discovery to identify candidate capabilities, inspect the selected schema and provider notes, then call with validated arguments. Do not treat a successful connection as evidence that every downstream capability is appropriate for the task.

Understanding capability routing

Capability routing starts from the task rather than a remembered provider name. A production policy should still filter candidates by data source, freshness, region, cost, latency, authentication, and allowed operations before selection.

  • "I need to check the weather in Tokyo" → routes to weather capability
  • "Get me the current Bitcoin price" → routes to cryptocurrency capability
  • "Search for recent news about AI" → routes to search capability

Centralized discovery reduces catalog work, but responsibility remains with the application. Validate inputs and outputs, attach provenance, set budgets and timeouts, redact secrets, and define deterministic fallbacks for critical tasks.

When to choose Qveris capability routing over manual MCP setup

Consider a managed layer when many read-oriented capabilities share the same governance model and your team values centralized discovery. Prefer direct servers when isolation, on-premises execution, custom authorization, or deterministic provider selection is mandatory.

  • You need 10+ capabilities: Installing and maintaining 10 individual MCP servers takes hours; Qveris capability routing handles this in one config line.
  • Your tools lack official MCP servers: Many internal tools, legacy systems, and niche services don't have published MCP servers. Qveris's capability routing can connect to these through its managed integrations.
  • You want centralized auth: Instead of managing separate API keys for each MCP server, Qveris capability routing uses a single authentication flow.
  • You're prototyping rapidly: Qveris capability routing lets you explore available capabilities before committing to specific server configurations.

Direct and managed paths can coexist. Keep sensitive or destructive integrations isolated, and use the managed layer for approved discovery-oriented capabilities. Document which path owns authentication, validation, logging, and incident response.

Step 4: Use Qveris capabilities

Use the documented discovery and inspection commands to identify a capability before calling it. Save the selected capability identifier, input schema, provider, expected units, and validation rules with the workflow definition.

# List available capabilities
qveris discover "file operations" --json

# Query financial data
qveris discover "cryptocurrency market data" --json

# Access map and location services
qveris discover "geographic data" --json

Comparing the four paths

Compare the four paths by deployment boundary, transport, credential ownership, operational responsibility, and control—not by optimistic setup-time promises.

Path Time Complexity Capabilities Maintenance
Path 1: Claude Desktop Host-dependent Low Per-server Per-server updates
Path 2: Cursor / IDEs Host-dependent Low Per-server Per-server updates
Path 3: Custom SDK Build-dependent Medium Custom-built Ongoing maintenance
Path 4: Qveris Under 1 min Managed many unified Single provider
Path comparison based on testing across all four integration methods. Times are estimates for developers familiar with their OS file system.

For a full comparison of MCP server options including prebuilt servers and managed approaches, see our server guide.

Access many Capabilities Without Managing Individual MCP Servers

Use QVeris to discover candidate capabilities, inspect schemas and provider notes, then call only the capability your application has approved.

Try Qveris CLI →

FAQ

How do I know an MCP integration is working?
Verify initialization, negotiated capabilities, tool discovery, schema validation, one known-answer read call, invalid-input rejection, permission denial, timeout behavior, and sanitized logs. A server merely appearing in the UI is not sufficient.
Do I need to code to connect an MCP server?
Usually not for an existing local server supported by your host; you configure and verify it. Building a custom server or client requires an official SDK, typed schemas, lifecycle handling, authorization, tests, and operations work.
Should I use stdio or Streamable HTTP?
Use stdio when a trusted host launches a local process for one client. Use Streamable HTTP when the server is independently deployed and serves remote clients. Remote deployment adds network authentication, concurrency, rate limits, and availability concerns.
Can one host connect to multiple MCP servers?
Yes. A host normally creates a dedicated MCP client connection for each server. Keep server names unique, scope credentials separately, disable unused tools, and monitor startup and schema drift for every connection.
What if no suitable MCP server exists?
Build the smallest server that matches the required operations and trust boundary with an official SDK. Use typed inputs, bounded outputs, server-side authorization, timeouts, structured errors, tests, and versioned deployment.
Does a managed capability layer replace MCP security controls?
No. It can centralize discovery and routing, but the application must still inspect schemas and provenance, scope credentials, validate results, enforce budgets and timeouts, redact secrets, and define fallbacks.

About this guide

Author: Linfang Wang, CEO & Founder, QVeris AI.

Last updated: August 4, 2026. Reviewed against the official MCP architecture, SDK, transport, authorization, server, client, and debugging documentation.

How we evaluated: We separated each path into host, client, server, transport, credentials, schema discovery, tool execution, result validation, and operations. Claims that could not be verified from current official documentation were removed.

Conflict of interest: QVeris publishes this guide and provides capability discovery and routing. The guide distinguishes QVeris from the MCP protocol and includes direct-server paths that may be a better fit for isolation or compliance.

Update cadence: Review after material MCP specification, SDK, host-configuration, or QVeris package changes. Verify current client instructions and package versions before deployment.

Related Guides