diff --git a/.cursor/mcp.json b/.cursor/mcp.json new file mode 100644 index 000000000..96a6f73e4 --- /dev/null +++ b/.cursor/mcp.json @@ -0,0 +1,7 @@ +{ + "mcpServers": { + "trigger.dev": { + "url": "http://localhost:3333/sse" + } + } +} diff --git a/packages/cli-v3/README.md b/packages/cli-v3/README.md index de0e576f3..d7fba79d5 100644 --- a/packages/cli-v3/README.md +++ b/packages/cli-v3/README.md @@ -19,6 +19,37 @@ Trigger.dev is an open source platform that makes it easy to create event-driven | [list-profiles](https://trigger.dev/docs/cli-list-profiles-commands) | List all of your CLI profiles. | | [update](https://trigger.dev/docs/cli-update-commands) | Updates all `@trigger.dev/*` packages to match the CLI version. | +## MCP Server + +The [Model Context Protocol (MCP)](https://modelcontextprotocol.io/introduction) is an open protocol that allows you to provide custom tools +to agentic LLM clients, like [Claude for Desktop](https://docs.anthropic.com/en/docs/claude-for-desktop/overview), [Cursor](https://www.cursor.com/), [Windsurf](https://windsurf.com/), etc... + +The Trigger.dev CLI can expose an MCP server and enable you interact with Trigger.dev in agentic LLM workflows. For example, you can use +it to trigger tasks via natural language, view task runs, view logs, debug issues with task runs, etc... + +### Starting the Trigger.dev MCP Server + +To start the Trigger.dev MCP server, simply pass the `--mcp` flag to the `dev` command: + +```bash +trigger dev --mcp +``` + +By default it runs on port `3333`. You can change this by passing the `--mcp-port` flag: + +```bash +trigger dev --mcp --mcp-port 3334 +``` + +### Configuring your MCP client + +This depends on what tool you are using. For Cursor, the configuration is in the [.cursor/mcp.json](../../.cursor/mcp.json) file +and should be good to go as long as you use the default MCP server port. + +Check out [Cursor's docs](https://docs.cursor.com/context/model-context-protocol) for further details. + +Tip: try out [Cursor's YOLO mode](https://docs.cursor.com/context/model-context-protocol#yolo-mode) for a seamless experience :D + ## Support If you have any questions, please reach out to us on [Discord](https://trigger.dev/discord) and we'll be happy to help. diff --git a/packages/cli-v3/src/commands/dev.ts b/packages/cli-v3/src/commands/dev.ts index b286341d0..b6c652d78 100644 --- a/packages/cli-v3/src/commands/dev.ts +++ b/packages/cli-v3/src/commands/dev.ts @@ -50,7 +50,6 @@ export function configureDevCommand(program: Command) { "--keep-tmp-files", "Keep temporary files after the dev session ends, helpful for debugging" ) - // TODO: add a more detailed description, maybe a pointer to the docs on how to use MCP .option("--mcp", "Start the MCP server") .option("--mcp-port", "The port to run the MCP server on", "3333") ).action(async (options) => {