Skip to main content

Tutorial Intro

With Coagent, you can connect any MCP server in any location from any MCP client anywhere securely.

Coagent supports MCP server running in

  • STDIO
  • Remote

The MCP client can connect to any MCP server without worry about they are running in STDIO or Remote so you can focus on building your AI application or agents.

This means, it's possible to run MCP server without exposing to the internet but reachable thru COA gateway. This make it possible to connect IOT devices or other internal services as MCP server.

Getting Started

Get started by creating MCP server.

Warning

The COA is in alpha testing. Current release is unstable and expected to change frequently. Please use with caution.

Pre-requisites

Follow guides to set up sdf and fluvio.

Set up SDF worker

Make sure you are running SDF worker either in your local cluster or in a InfinyOn Cloud.

You can check running worker by:

$ sdf worker list

Installing COA CLI

To install coa, run the following command:

fvm install sdf-beta12-dev

You can check the installation by running:

coa --version

Deploy COA gateway

The COA gateway is a server side component that need to be installed into SDF worker. This only need to be done once.

$ coa deploy

This will install gateway into SDF worker.

Registering and exposing local MCP server

This example shows how to register and expose local MCP server to outside MCP client. The MCP server does not need to be exposed to the internet but reachable thru COA gateway.

Registering Local MCP server

To register and expose local MCP server, run the following command:

$ coa gateway local --tool-file <TOOL_FILE>

The tool file is a JSON file that contains how to start local MCP server and their id. For example, here is sample tool file to expose adder.

{
"tools": {
"adder": {
"command": "/home/adder",
"args": []
}
}
}

You can register many tools in a single file.

Accessing MCP Server thru Proxy

Once MCP server is registered, you can access it thru COA proxy. The proxy will allow MCP server to be accessed locally or remotely.

To access MCP server by local MCP client, run the following command as STDIO in any MCP client such as Claude desktop

coa proxy local <SERVER_ID>

For example, in the claude, you would add tool config:

{
"mcpServers": {
"adder": {
"command": "/home/coa",
"args": [
"proxy",
"local",
"adder"
]
}
}
}

Note that this is proxy config. COA will route all MCP requests to the gateway. The adder tool can run anywhere.