Skip to main content

LoyJoy Agent as MCP Server

Every agent you create in LoyJoy can be used as a MCP server. Model Control Protocol (MCP) is a protocol that allows you to control the agent from an external application. This means you can use the agent as a server to handle requests and responses, making it a powerful tool for building interactive applications.

How to use an agent as a MCP server

You can use the agent as a MCP server by sending requests to the agent's URL. The URL format is as follows:

https://app-stable.loyjoy.com/mcp/<AGENT_ID>

You can find the <AGENT_ID> if you open an agent and use the ID from the URL in your browser. For example, if the URL is https://cloud.loyjoy.com/processes/12345, then the <AGENT_ID> is 12345.

The authorization for the MCP server is done using an API key from the tenant. While you're logged in, open this URL https://cloud.loyjoy.com/settings/tenant?tab=api and click on the "Add API bearer token" button. This will generate a new API key for you. You can use this key to authorize your requests to the MCP server.

In the agent there needs to exist a message start event, followed by an Agentic AI process module, followed by the end event. In the Agentic AI module, you can configure the tools that should be made available via the MCP server. If no such Agentic AI module exists, the MCP endpoint will throw an HTTP status 400 error.