# Add Exposed Pipeline

<Heading
  as={"h1"}
  className={"openapi__heading"}
  children={"Add Exposed Pipeline"}
>
</Heading>

<MethodEndpoint
  method={"post"}
  path={"/api/v2/workspaces/{workspace_id}/mcp/config/pipelines"}
  context={"endpoint"}
>
  
</MethodEndpoint>

Expose a pipeline as an MCP tool.

The pipeline must exist in the same workspace. Optionally provide
a custom tool name and description that will be shown to MCP clients.

<Heading
  id={"request"}
  as={"h2"}
  className={"openapi-tabs__heading"}
  children={"Request"}
>
</Heading>

<ParamsDetails
  parameters={[{"description":"Type the id of the workspace.","in":"path","name":"workspace_id","required":true,"schema":{"description":"Type the id of the workspace.","format":"uuid","title":"Workspace Id","type":"string"}}]}
>
  
</ParamsDetails>

<RequestSchema
  title={"Body"}
  body={{"content":{"application/json":{"schema":{"description":"Request to expose a pipeline as an MCP tool.","properties":{"custom_instructions":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Additional instructions appended to the tool description to guide LLM behaviour.","title":"Custom Instructions"},"custom_tool_description":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Custom description for the MCP tool.","title":"Custom Tool Description"},"custom_tool_name":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Custom tool name shown to MCP clients. Defaults to the pipeline name.","title":"Custom Tool Name"},"pipeline_id":{"description":"ID of the pipeline to expose via MCP.","format":"uuid","title":"Pipeline Id","type":"string"},"pipeline_version_id":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}],"description":"Optional pipeline version ID. When set, MCP tool execution loads the query YAML from this specific version instead of the pipeline's current YAML.","title":"Pipeline Version Id"}},"required":["pipeline_id"],"title":"ExposePipelineRequest","type":"object"}}},"required":true}}
>
  
</RequestSchema>

<StatusCodes
  id={undefined}
  label={undefined}
  responses={{"201":{"content":{"application/json":{"schema":{"description":"Response for an exposed pipeline MCP tool mapping.","properties":{"created_at":{"format":"date-time","title":"Created At","type":"string"},"custom_instructions":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Custom Instructions"},"custom_tool_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Custom Tool Description"},"custom_tool_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Custom Tool Name"},"mcp_exposed_pipeline_id":{"format":"uuid","title":"Mcp Exposed Pipeline Id","type":"string"},"pipeline_id":{"format":"uuid","title":"Pipeline Id","type":"string"},"pipeline_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pipeline Name"},"pipeline_version_id":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}],"title":"Pipeline Version Id"},"updated_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Updated At"}},"required":["mcp_exposed_pipeline_id","pipeline_id","custom_tool_name","custom_tool_description","custom_instructions","pipeline_version_id","created_at","updated_at"],"title":"ExposedPipelineResponse","type":"object"}}},"description":"Successful Response"},"422":{"content":{"application/json":{"schema":{"properties":{"detail":{"items":{"properties":{"ctx":{"title":"Context","type":"object"},"input":{"title":"Input"},"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"title":"Location","type":"array"},"msg":{"title":"Message","type":"string"},"type":{"title":"Error Type","type":"string"}},"required":["loc","msg","type"],"title":"ValidationError","type":"object"},"title":"Detail","type":"array"}},"title":"HTTPValidationError","type":"object"}}},"description":"Validation Error"}}}
>
  
</StatusCodes>
