Custom MCP servers
CoAgent can be expanded to include custom MCP servers. Enter project-specific servers in .coagent/mcp.json in the TwinCAT Solution folder (see the “Project Workspace” chapter). Create the file if necessary. It is loaded for the open solution; changes are applied automatically (hot reload). A project-specific entry takes precedence over a global entry with the same server name.
Use valid JSON with double quotes, without comments or trailing commas. Windows paths can be specified using / or by using two backslashes ( \\ ).
Example of an MCP server configuration:
{
"mcpServers": {
"mein-server": {
"type": "stdio",
"command": "C:/Pfad/zur/python.exe",
"args": ["C:/Pfad/zum/server.py"],
"env": {
"MEINE_VARIABLE": "wert"
}
}
}
}Adjust the executable program path and the script path to match your local installation. For a remote server using Streamable HTTP, specify its MCP endpoint instead:
{
"mcpServers": {
"mein-http-server": {
"type": "http",
"url": "https://mcp.example.com/mcp"
}
}
}The URL is a placeholder. If necessary, include the authentication headers required by the server. The following table describes the parameters for these connection types:
Parameter | Required | Meaning |
|---|---|---|
| For HTTP | "stdio" starts a local process (default if not specified), "http" uses Streamable HTTP. A URL alone does not determine the connection type. |
| For stdio | Executable file for starting the server. Arguments are specified separately. |
| No | List of individual arguments, such as the script path. |
| No | Additional environment variables for the stdio process as key/value pairs with strings. |
| No | Working directory for the stdio process. It is best to use an absolute path. |
| For HTTP | The full URL of the MCP endpoint, not a web page or an older SSE endpoint. |
| No | HTTP headers as key/value pairs containing strings, such as for authentication. |
| No | Timeout in seconds for establishing a connection and for requests to the server (default: 15). The abbreviation |
| No | Time limit in seconds for a tool call to this server. If not specified, the MCP Tool Call Timeout from the general settings applies. |
| No | Additional options as an object: |
Tool approvals are managed as described in the Tool Approvals chapter. Also select the tools required for the agent.
To create an MCP server, use the Python package mcp ( pip install mcp ) or a compatible SDK. The specification is available at https://modelcontextprotocol.io/.