AGTCloud API Docs
GuidesAPI ReferenceIntegrations and resourcesUpdate and help

MCP Access and Security

Understand MCP architecture, transports, and permission boundaries, and securely connect to third-party or self-hosted MCP servers.

Model Context Protocol (MCP) is an open protocol that connects AI applications with external systems. Compatible clients can access context, invoke tools, or use predefined prompts via the MCP Server without having to design separate access protocols for each data source.

MCP and model APIs are different access layers

The AGTCloud API handles model calls, while an MCP server exposes tools and context to compatible clients. When connecting to MCP, use the installation commands, URLs, and authentication methods provided by the server publisher or administrator. An AGTCloud model API address is not an MCP server endpoint.

How MCP works

An MCP Host can connect to multiple MCP Servers and create independent MCP Clients for each server.

ParticipantsMain responsibilitiesCommon forms
MCP HostRuns the AI application and manages connections, permissions, and user confirmationsCoding agents, IDEs, desktop assistants
MCP ClientEstablish a dedicated connection to an MCP Server and provide Server capabilities to the HostIt is usually built into the Host
MCP ServerExposes specific tools, data, or prompt templatesLocal subprocesses, remote services

MCP has a data layer and a transport layer. The data layer defines JSON-RPC messages, capability discovery, and primitives; the transport layer defines how messages move between local processes or across a network. Clients usually handle these protocol details, so follow the MCP configuration interface provided by the client.

What can the Server provide?

MCP Server mainly exposes three types of Primitives:

PrimitiveControl methodsFunctionFocus on checking when connecting
ToolsThe model can be called selectively, and the Host is responsible for executing policies and authorizationsPerform operations or queries, such as calling APIs, writing files, or querying databasesInput schema, write operations, external side effects, and whether manual approval is required
ResourcesSelected and managed by the applicationProvide the model with contextual information such as files, records, and API responsesData scope, sensitive information, update frequency, content credibility
PromptsUsually chosen by users proactivelyProvides reusable interaction templates and parametersTemplate source, parameter meaning, and whether it contains external commands

The server declares its capabilities, and the client discovers the available Tools, Resources, and Prompts. A declared capability is not necessarily enabled; the final behavior also depends on the Host version, permission policy, and user choices.

Treat the server's returned content as external input

Resources, tool results, and prompts may all contain untrusted content. Do not automatically allow instructions to access other files, credentials, or system services just because they return through MCP.

Select a transport

The current MCP specification defines two standard transports: stdio and Streamable HTTP.

TransportHow it worksBest suited forMain risks
stdioThe client starts a local server subprocess and exchanges JSON-RPC messages through standard input and outputLocal tools, controlled directories, and servers that do not require network deploymentThe startup command runs locally; the server inherits process permissions and some environment information
Streamable HTTPThe client sends an HTTP POST request to a single MCP endpoint; the server returns JSON or an SSE stream for that requestRemote services, shared team capabilities, and servers that require network authenticationService identity, OAuth or token handling, network boundaries, data exposure, and remote side effects

For stdio, the server must write only MCP messages to stdout; logs should go to stderr. When a connection fails, inspect the stderr logs captured by the client, but do not send logs containing credentials to third parties.

Streamable HTTP currently uses a single POST endpoint and does not require separate GET or legacy HTTP+SSE addresses. Authentication is determined by the server. If the server provides an OAuth flow, use its authorization page instead of writing long-lived credentials directly into shared configuration.

Understand the configuration structure

Field names and configuration locations vary by client. The following examples show common structures and cannot be used as-is. Replace every placeholder with the commands, arguments, URLs, and authentication method supplied by the server publisher.

{
  "mcpServers": {
    "replace-with-server-name": {
      "command": "/absolute/path/to/server-command",
      "args": [
        "--replace-with-required-argument"
      ],
      "env": {
        "SERVICE_API_KEY": "replace-with-client-supported-secret-reference"
      }
    }
  }
}
  • command is the program actually executed by the client; before connecting, the full path and source must be verified;
  • args may include accessible directories, configuration files, or Server parameters;
  • env should pass only the minimum environment variables required by the server. Credential-reference syntax varies by client.

Do not directly copy unknown startup commands

command and args in the local MCP configuration will run on your computer. Do not run one-click install commands from unknown sources, and do not use the entire home directory, SSH directory, or system directory as the default access range.

Steps for secure access

1. Check client support

Confirm that the client supports MCP and check whether it supports stdio or Streamable HTTP. Use the configuration format corresponding to the current client version; do not guess fields based on examples from other clients.

2. Verify the server identity

Obtain installation instructions from the official server repository, vendor console, or organization administrator. Check the publisher, version, update history, dependencies, and uninstall procedure. For a remote server, also verify the domain, HTTPS configuration, and authentication flow.

3. Inventory capabilities and permissions

Review the Tools, Resources, and Prompts exposed by the server before enabling it. Record each tool's inputs, read scope, write operations, and external side effects, and disable capabilities unrelated to the current task.

4. Configure the minimum range

For local servers, allow only the required directories and environment variables. For remote servers, use least-privilege accounts or scopes. Do not send model API keys to unknown servers as generic MCP credentials.

5. Reload and check

Reload the configuration according to the client's instructions, confirm that the server can connect, and check that the client's displayed capability list matches expectations. A successful connection does not mean all Tools should be enabled.

6. Start with read-only operations

First, list the capability, read a non-sensitive resource, or call a tool without side effects. After confirming input, output, and logs, allow file writing, data modification, or external system calls item by item.

Permission review checklist

ScopeConfirm before connecting
Local filesWhich directories can the server read and write to, and whether it follows symbolic links or accesses files outside the directory
Run commandsWhich programs the Tool runs, and whether parameters are directly controlled by the model or external content
Network accessWhich domains, intranet services, and third-party APIs the Server accesses
CredentialsWhere the Key or Token is stored, which process or domain receives it, and whether it can be revoked independently
Data processingWhether inputs and results leave the local machine, and how service providers store logs and call data
Write operationsWhether modifications, deletions, submissions, payments, or messages require explicit confirmation
UpdateWhen server packages or remote capabilities change, will the client redisplay permissions?

For remote servers, connect only to trusted HTTPS endpoints and follow the documented authentication flow. For local servers, prefer absolute command paths, isolated directories, and standard user privileges. Do not run with administrator privileges merely for convenience.

Frequently Asked Questions

IssueWhat to checkResolution
Server cannot startCommand path, runtime, parameters, and working directoryConfirm the program exists in a regular terminal, but do not bypass the client to execute unknown commands directly
The client shows connected, but no Tool is availableServer capabilities, client permissions, and versionsReload the capability list and confirm that the client supports the Primitive
stdio disconnects immediately after connectingWhether the server writes ordinary logs to stdoutWrite logs to stderr and reserve stdout for MCP messages only
Remote Endpoint returns 401 or 403Server authentication methods, tokens, and scopeReauthorize according to the Server documentation; do not switch to tokens from other services
Remote Endpoint returns 404Does the URL contain the full MCP path?Use the Endpoint provided by the Server publisher; do not add the model API path yourself
Tools can read but cannot writeTool permissions, directory scope, and manual confirmationOnly expand permissions when truly necessary and revoke tests again
Tool behavior does not match the descriptionServer version, Tool Schema, and external inputsDisable the tool immediately, save redacted evidence, and contact the server publisher
Unexpected external requests occur after connectionServer network permissions and data flow directionsDisconnect the server, revoke credentials, and check logs and host network activity

Continued use recommendations

  • Regularly review the list and authorization scope of connected servers, versions, tools, and scopes;
  • Use separate, revocable, least-privilege credentials for different servers;
  • Maintain manual confirmation, especially for deletion, writing, payment, message sending, and production system operations;
  • Do not treat instructions in unknown Resources or Tool results as trusted system instructions;
  • Logs, screenshots, and error reports must remove Keys, Tokens, customer data, and sensitive paths;
  • When you stop using the server, remove the configuration from the client and revoke the related credentials.

If you need to configure AGTCloud for a model client, start with the CC-Switch integration guide, or choose a specific tool from Third-party integrations in the sidebar. To understand model endpoints and request fields, see API Reference. For protocol details and version changes, refer to the official MCP documentation.

On this page