@loopstack/mcp-linear-example-workflow
Demonstrates how to connect a Loopstack chat agent to Linear’s hosted MCP server using @loopstack/mcp-module.
By using this example you’ll get…
- A parent workflow that launches
ChatAgentWorkflowwithmcp_list_toolsandmcp_call - A reference
@InjectToolconfig withallowedHostsandhostHeaderEnv(on the workflow class for documentation) - A safe, minimal pattern for talking to a hosted MCP server with OAuth-style auth
Workspace registration required. Because this example uses
ChatAgentWorkflowas a sub-workflow, MCP tools must also be registered on your workspace with the same@InjectToolconfig — not only onMcpLinearExampleWorkflow. While the chat agent runs, tool resolution uses the executing workflow (ChatAgentWorkflow) and then the workspace. See @loopstack/mcp-module — Registering the tools . The app template shows this indefault.workspace.ts.
Installation
npm install @loopstack/mcp-linear-example-workflowThe package depends on @loopstack/mcp-module and @loopstack/agent.
Environment
Set the Linear OAuth token (the header value is sent raw, so include the Bearer prefix):
LINEAR_MCP_TOKEN="Bearer lin_oauth_..."Linear’s MCP endpoint requires an OAuth access token. Personal API keys (
lin_api_*) will not authenticate.
How It Works
- Import
McpModuleand registerMcpListToolsTool/McpCallToolon your workspace withmcp.linear.appinallowedHosts(copy the config frommcp-linear-example.workflow.ts). hostHeaderEnvmapsAuthorization→LINEAR_MCP_TOKENfor the Linear host. The value is read at call time, never logged.McpLinearExampleWorkflowstartsChatAgentWorkflowwithtools: ['mcp_list_tools', 'mcp_call'].- The chat agent calls Linear’s MCP at
https://mcp.linear.app/mcpover Streamable HTTP.
Public API
McpLinearExampleModuleMcpLinearExampleWorkflow
Dependencies
@loopstack/common@loopstack/agent@loopstack/mcp-module