2 Commits
v0.3.0 ... main

Author SHA1 Message Date
fc723c5f53 chore: release v0.3.1
Some checks failed
container-images / build-container-image (push) Has been cancelled
Release / release (push) Has been cancelled
2026-03-01 23:25:19 +01:00
7f138af4b5 fix: add project parameter for mcp in container 2026-03-01 23:20:19 +01:00
3 changed files with 13 additions and 5 deletions

2
Cargo.lock generated
View File

@@ -1557,7 +1557,7 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
[[package]]
name = "todo-mcp"
version = "0.3.0"
version = "0.3.1"
dependencies = [
"anyhow",
"chrono",

View File

@@ -1,6 +1,6 @@
[package]
name = "todo-mcp"
version = "0.3.0"
version = "0.3.1"
edition = "2024"
rust-version = "1.85"
description = "simple todo cli with mcp server for ai integration"

View File

@@ -55,7 +55,8 @@ fn tool_schemas() -> Value {
"text": { "type": "string", "description": "todo text" },
"priority": { "type": "string", "enum": ["low", "medium", "high", "critical"] },
"tags": { "type": "array", "items": { "type": "string" } },
"no_project": { "type": "boolean" }
"no_project": { "type": "boolean" },
"project": { "type": "string", "description": "explicit project path, use when the server cannot auto-detect git repos (e.g. running in a container)" }
},
"required": ["text"]
}
@@ -70,6 +71,7 @@ fn tool_schemas() -> Value {
"priority": { "type": "string", "enum": ["low", "medium", "high", "critical"] },
"search": { "type": "string" },
"here": { "type": "boolean", "description": "only show todos for current repo" },
"project": { "type": "string", "description": "explicit project path to filter by, use when the server cannot auto-detect git repos (e.g. running in a container)" },
"all": { "type": "boolean", "description": "include completed todos" }
}
}
@@ -156,7 +158,12 @@ async fn dispatch(pool: &Pool, name: &str, args: &Value) -> Value {
.unwrap_or_default();
let tags = str_array(args, "tags");
let no_project = args.get("no_project").and_then(|v| v.as_bool()).unwrap_or(false);
let project = if no_project { None } else { db::detect_project() };
let explicit_project = args.get("project").and_then(|v| v.as_str()).map(String::from);
let project = if no_project {
None
} else {
explicit_project.or_else(db::detect_project)
};
db::insert_todo(pool, text, &priority, project.as_deref(), &tags)
.await
.map(|t| serde_json::to_string(&t).unwrap())
@@ -168,7 +175,8 @@ async fn dispatch(pool: &Pool, name: &str, args: &Value) -> Value {
let search = args.get("search").and_then(|v| v.as_str()).map(String::from);
let here = args.get("here").and_then(|v| v.as_bool()).unwrap_or(false);
let all = args.get("all").and_then(|v| v.as_bool()).unwrap_or(false);
let project = if here { db::detect_project() } else { None };
let explicit_project = args.get("project").and_then(|v| v.as_str()).map(String::from);
let project = explicit_project.or_else(|| if here { db::detect_project() } else { None });
db::list_todos(
pool,
ListFilters {