Skip to main content
Version: dev

Deploy a tool

An MCP tool gives an agent access to an external service, an interface or a set of data. The procedure is the procedure for an agent. The differences are the ports, the registry options, and the method that an agent uses to find the tool.

What a tool must be

A tool is a container that uses the MCP protocol over HTTP:

EndpointMethodFunction
/mcpPOSTReceives MCP messages

The default service port is 9090. For examples in several languages, see examples/mcp.

Deploy from a container image

With the console

Select Tools, then Import new tool, then Deploy from existing image. Enter the image address, add the environment variables that the tool needs, and select Deploy.

With the CLI

rossoctl tools import from-image \
--name weather-mcp \
--containerImage ghcr.io/acme/weather-mcp:v1.0.0

rossoctl tools wait weather-mcp

To set the ports, use the --ports option. The format is name:port:targetPort[:protocol]. The default is http:9090:9090:TCP. A number alone means http:<port>:<port>:TCP.

rossoctl tools import from-image --name weather-mcp \
--containerImage ghcr.io/acme/weather-mcp:v1.0.0 \
--ports grpc:9000:9001:TCP,8080

Each other option is the option for an agent. See Deploy an agent.

Build from source

The requirements are the requirements for an agent: the --with-builds option, a GitHub repository, and a subdirectory that contains a Dockerfile.

For a tool you can also select the destination of the image:

FieldFunction
Registry URLWhere to send the image. Use registry.cr-system.svc.cluster.local:5000 for the registry in the cluster, or an address such as quay.io/myorg.
Registry SecretThe Kubernetes Secret that holds the registry credentials. It is necessary for an external registry.
Image tagThe default is v0.0.1.

Rossoctl selects the build strategy from the registry, in the same way that it does for an agent.

A build needs more time than the default limit

The rossoctl tools wait command has a default limit of 60 seconds. A build from source needs more time. Give a longer limit:

rossoctl tools wait weather-mcp --timeout 10m

If the build fails, the command reports Build Failed and exits at once. It does not wait for the time limit.

Connect an agent

Set MCP_URL on the agent to the address of the tool in the cluster:

MCP_URL=http://weather-tool:8080/mcp

For more than one tool, use MCP_URLS with a list that commas separate. For many tools and many agents, use the MCP Gateway.

To change an agent that already runs:

kubectl set env deployment/weather-service -n team1 \
MCP_URL="http://weather-tool:8080/mcp"

The example agents in rossoctl/examples have an .env.openai file and an .env.ollama file. The default values in those files assume that the tool is in the same namespace as the agent.

Examine a tool

rossoctl tools list
rossoctl tools list --all-namespaces
rossoctl tools get weather-mcp
rossoctl tools get weather-mcp --json

In the console, the MCP Gateway page can start the MCP Inspector for a registered tool. The Inspector is the fastest method to read the list of functions that a tool gives.

Delete a tool

rossoctl tools delete weather-mcp

An agent that has the address of that tool then fails each tool call. Change the MCP_URL value of each such agent first.