Add stdio MCP server for token-scoped ticket access.
CI / test-and-build (push) Failing after 1m25s
CI / demo (push) Skipped

Expose tm mcp tools against the local daemon, document agent setup, and
ignore workspace .tm_token files.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-11-01 16:56:11 +01:00
co-authored by Cursor
parent 2dbf0918de
commit 846bb31dc9
10 changed files with 510 additions and 3 deletions
+25 -2
View File
@@ -12,6 +12,7 @@ import (
"task/internal/daemon"
"task/internal/daemon/api"
"task/internal/daemon/client"
mcpserver "task/internal/mcp"
"task/internal/ui"
"task/internal/version"
)
@@ -215,7 +216,29 @@ func runSync(args []string) error {
}
func runMCP() error {
return fmt.Errorf("mcp server not implemented yet — coming in phase 2")
cwd, err := os.Getwd()
if err != nil {
return err
}
tf, err := mcpserver.FindTokenFile(cwd)
if err != nil {
return err
}
cfg, err := loadConfig()
if err != nil {
return err
}
paths, err := daemon.Ensure(cfg)
if err != nil {
return fmt.Errorf("daemon: %w", err)
}
cli := client.Dial(client.Options{
Socket: paths.Socket,
Kind: api.ClientMCP,
Token: tf.Token,
Project: tf.Project,
})
return mcpserver.ServeStdio(cli, tf)
}
func printHelp() {
@@ -238,7 +261,7 @@ Env:
The TUI talks to a per-DataDir background daemon over a Unix socket so multiple
instances stay consistent. Create an MCP token from the project list (key g);
place it in a repo as .tm_token for AI access.
place project= and token= in a repo .tm_token file, then run: tm mcp
`, config.CliName, config.CliName, config.CliName, config.CliName, config.CliName, config.CliName, config.CliName, config.CliName, config.CliName, config.CliName)
}