Create custom Cortex MCP server tools
Create custom OpenAPI and Python tools for Cortex MCP server workflows in Cortex AgentiX.
You can build your own tools using OpenAPI or Python to manage cases, handle issues, and conduct investigations. More detailed information can be found in the README file located in the src/usecase directory. Tools are based on Cortex API endpoints.
Create custom Cortex MCP server tools with OpenAPI
You can create an OpenAPI specification for a specific API endpoint.
Create a YAML file in the
/custom_components/openapidirectory with the name of the MCP component. For example:custom_cortex_component.yaml.Base your custom OpenAPI component on the Cortex API documentation structure for a specific endpoint. We recommend viewing the built-in tools, located at
/builtin_components/openapi, as a reference.After you define the OpenAPI specification, the Cortex MCP server collects it automatically and it is ready for use.
Test your new MCP component by running the Cortex MCP server and writing a prompt that uses your new component.
Create custom Cortex MCP server tools with Python
We recommend using Python for more complex MCP components that require custom logic. MCP components in Python are defined in a module.
Create a new Python file in the
/custom_componentsdirectory.Define a class that inherits from the
BaseModuleclass with the required methods. We recommend viewing the built-in modules, located at/builtin_components, as a reference.After you define a class, the Cortex MCP server collects it automatically and it is ready for use.
Test your new MCP component by adding an end-to-end test in the
tests/e2edirectory or run the MCP server and write a prompt that uses your new component.
Last updated
Was this helpful?
