MMOOZZGG.com

How to build an AI agent

How to connect an MCP server to an AI agent

8 min read14 sources

How to connect an MCP server to an AI agent: choose a ready server or build your own, give the agent its address and leave only the actions it needs. Anthropic opened the MCP protocol on 25 November 2024, and by December 2025 more than 10,000 MCP servers had been published.

On this page · 5 sections

A developer is needed

What MCP gives you

MCP (Model Context Protocol) is an open protocol, that is, a shared rule for exchanging data between an AI agent and a company’s services. Anthropic opened it on 25 November 2024 as one standard way to connect AI to data and services.

The practical point is simple. A service is described once, and any agent that supports the protocol can connect to it. Without MCP, the connection is written again for each program.

There are three parts in the scheme. The host is the program in which the agent runs. The client is the connection module inside the host: the host creates a separate client for each connected server. The server is the program that gives the agent access to a CRM, a file folder or a database.

A server gives the agent three kinds of capabilities. Tools are actions, such as finding a customer. Resources are data for context, such as a product card. Prompt templates are ready-made requests to the model.

The agent asks the server for the list of tools by itself. So a new tool on the server appears for the agent without any change to the agent.

On 9 December 2025, the Linux Foundation created the Agentic AI Foundation, and Anthropic handed MCP over to it. A non-profit foundation, not one company, now develops the protocol.

Ready servers

More than 10,000 published servers mean that for many services the connection is already written. Start with a search, not with development.

The protocol’s developers keep 7 reference servers: Everything, Fetch, Filesystem, Git, Memory, Sequential Thinking and Time. They show what the protocol can do: work with files, load web pages, store the agent’s memory as a knowledge graph, convert time between time zones.

The official MCP Registry collects descriptions of public servers. It is still in preview and stores only descriptions with links to packages. A listing in the registry does not mean the server has been checked for security.

There are no private servers in the public registry. For a company’s internal systems, the protocol’s developers advise keeping your own closed registry.

A ready server does not always exist for your company’s CRM and 1C. Each company has its own 1C configuration and CRM fields, so a server for them is often built separately. The section below covers this.

Connecting to the agent

Below is the path in n8n. You can install this platform on your own server and connect an open model to it through Ollama. How to build a first agent in n8n is covered separately.

1. Open a workflow with the “AI Agent” node and click “Tool +” on that node to add a tool.

2. Type the service name in the search or open the “MCP Servers” section, which collects servers from the n8n registry.

3. Choose a server and sign in to the service account when n8n asks. n8n creates the credentials for the connection by itself.

4. In the “Tools to include” field (which tools to give the agent), choose “All”, “Selected” (only the chosen ones) or “All Except” (all except the chosen ones).

If the server is not in the n8n registry, for example it is your own server, connect it with the “MCP Client Tool” node.

5. Click “Tool +” on the agent node and add the “MCP Client Tool” node.

6. Paste the server address into the “SSE Endpoint” field. SSE (Server-Sent Events) is a way for the server to stream its answers over a normal web connection.

7. In the “Authentication” field, choose the method: “Bearer” (a token, that is, a long secret key), a header, several headers or OAuth2. The “None” option connects the server without any check; keep it only for tests.

8. In the “Tools to Include” field, mark the tools the process needs, and do not give the agent the rest.

Other agent programs connect a local server through a settings file. In the example from the MCP documentation, the “mcpServers” section sets the server name, the launch command “command” and the arguments “args”: the @modelcontextprotocol/server-filesystem package and the folders the server will get access to.

Such a server runs on your computer through stdio, that is, it exchanges messages with the program directly, with no network. A remote server works through Streamable HTTP, normal web requests with a token check. The protocol advises getting tokens through OAuth, a sign-in standard in which the agent never sees your password.

Your own server for 1C or a CRM

You build your own server when no ready one exists or it gives the agent too much. Typical tasks: find a stock balance in 1C, create a deal in the CRM, get an order status. How the agent works with an accounting system in our projects is described on the page on integration with 1C, the accounting software.

Without code, you build your own server in n8n. The “MCP Server Trigger” node turns n8n into an MCP server: it gives an address through which outside agents get the list of your tools and call them one by one.

You connect n8n tools to the node. A ready workflow, such as “find a customer in the CRM”, is added with the “Custom n8n Workflow Tool” node. This way one tested chain of steps becomes one tool of the agent.

The node has two addresses. The test one works while you check the workflow in the editor. The production one appears after you publish the workflow, and its runs show on the “Executions” tab.

The node accepts SSE and Streamable HTTP connections and does not support stdio. You choose access control in the “Authentication” field: “None”, “Bearer auth” or “Header auth”. For a server with access to customer data, turn on the token.

With code, a developer writes the server on one of the official SDKs, ready-made libraries of the protocol. There are 10 of them, including Python, TypeScript, C#, Go and Java. In the Python SDK, the tool description is built from the function name, the type hints and the explanation in the code.

Before you connect a server to an agent, test it in MCP Inspector, a tool from the protocol’s developers. The command npx @modelcontextprotocol/inspector opens it in the browser: you see each tool of the server and can call it without the model.

Access security

A local MCP server is a normal program with the rights of your account. The MCP documentation warns: it sees environment variables with keys and the files you can access, and it can send data to the internet.

The model reads tool descriptions as instructions. A server can hide someone else’s commands in them and change how the agent works with other servers. The protocol’s developers call this tool poisoning.

What the MCP documentation advises: install servers with open code and a known author, and pin the version; run third-party servers in a container, a separate isolated environment; give each server its own token with minimal rights; open one folder, read-only; block network access if the server does not need it.

In n8n the same rule works through the “Tools to Include” field: the agent gets only the tools it needs. The n8n documentation notes that a built-in tool with set parameters gives more control than an MCP server, where the model itself chooses the call and all its parameters.

If customer data goes through the server, 152-FZ, Russia’s personal data law, applies. Data of Russian citizens is collected and stored in databases on Russian territory, and before a transfer abroad the operator files a notice with Roskomnadzor, the data protection regulator. How we handle this is described on the page about data security.

The full list of checks before launch is in the agent security checklist: rights, an action log, hand-off to a person.

Sources and fact-checking

Checked by the editors on 16 October 2026.

  1. Anthropic, 25 November 2024 (anthropic.com)
  2. Linux Foundation, 9 December 2025 (linuxfoundation.org)
  3. Brace Law Firm, 9 July 2023 (brace-lf.com)
  4. Model Context Protocol, Architecture overview, 2026 (modelcontextprotocol.io)
  5. GitHub, modelcontextprotocol/servers, 2026 (github.com)
  6. Model Context Protocol, The MCP Registry, 2026 (modelcontextprotocol.io)
  7. Model Context Protocol, Local Server Security, 2026 (modelcontextprotocol.io)
  8. n8n documentation: MCP servers, checked 16 October 2026 (docs.n8n.io)
  9. n8n documentation: MCP Client Tool, checked 16 October 2026 (docs.n8n.io)
  10. n8n documentation: MCP Server Trigger, checked 16 October 2026 (docs.n8n.io)
  11. MCP documentation: Connect to local MCP servers, checked 16 October 2026 (modelcontextprotocol.io)
  12. MCP documentation: SDKs, checked 16 October 2026 (modelcontextprotocol.io)
  13. MCP documentation: Build an MCP server, checked 16 October 2026 (modelcontextprotocol.io)
  14. MCP documentation: MCP Inspector, checked 16 October 2026 (modelcontextprotocol.io)

Found a mistake? Tell us

Publications

Mike Mozg

Agentic AI use cases at AT&T: nearly 500 processes now run on agents

AT&T no longer uses AI only to help staff work faster: it is rebuilding whole business processes around agents. SiliconANGLE reported on 14 November 2026 that nearly 500 agentic AI use cases at AT&T are already in production. Here is how the company rebuilds them, where a human still checks the agent, and what other large companies can take from it.

News4 min
Contact us