* Implementation is complete. Let me provide a summary of the changes made:
## Summary
I've implemented tag expansion for the MCP server. Here are the changes:
### Files Modified
1. **`crates/server/Cargo.toml`** - Added `regex = "1"` dependency
2. **`crates/server/src/mcp/task_server.rs`** - Three changes:
- Added imports for `Tag` and `Regex`
- Added `expand_tags()` helper function that:
- Finds all `@tagname` patterns using regex `@([^\s@]+)`
- Fetches tags from `/api/tags` endpoint
- Replaces each `@tagname` with the tag's content
- Returns original text if tag not found or on error
- Updated `create_task` to expand tags in description before creating
- Updated `update_task` to expand tags in description before updating
- Updated tool descriptions to mention tag expansion support
### How It Works
When an AI agent calls `create_task` or `update_task` with a description containing `@tagname` (e.g., `"Please implement this feature @requirements"`), the MCP server will:
1. Parse the description for `@tagname` patterns
2. Fetch all available tags from the backend API
3. Replace each `@tagname` with the corresponding tag's `content`
4. Save the task with the expanded description
If a tag is not found, the `@tagname` is left as-is. If there's a network error, the original text is preserved to ensure task creation doesn't fail.
* Update crates/server/src/mcp/task_server.rs
Co-authored-by: Solomon <abcpro11051@disroot.org>
* Update crates/server/src/mcp/task_server.rs
Co-authored-by: Solomon <abcpro11051@disroot.org>
---------
Co-authored-by: Solomon <abcpro11051@disroot.org>
54 lines
1.6 KiB
TOML
54 lines
1.6 KiB
TOML
[package]
|
|
name = "server"
|
|
version = "0.0.131"
|
|
edition = "2024"
|
|
default-run = "server"
|
|
|
|
[lints.clippy]
|
|
uninlined-format-args = "allow"
|
|
|
|
[dependencies]
|
|
deployment = { path = "../deployment" }
|
|
executors = { path = "../executors" }
|
|
local-deployment = { path = "../local-deployment" }
|
|
remote = { path = "../remote" }
|
|
utils = { path = "../utils" }
|
|
db = { path = "../db" }
|
|
services = { path = "../services" }
|
|
tokio = { workspace = true }
|
|
shlex = "1.3.0"
|
|
tokio-util = { version = "0.7", features = ["io"] }
|
|
axum = { workspace = true }
|
|
serde = { workspace = true }
|
|
serde_json = { workspace = true }
|
|
anyhow = { workspace = true }
|
|
tracing = { workspace = true }
|
|
tracing-subscriber = { workspace = true }
|
|
sqlx = { version = "0.8.6", features = ["runtime-tokio-rustls", "sqlite", "sqlite-preupdate-hook", "chrono", "uuid"] }
|
|
chrono = { version = "0.4", features = ["serde"] }
|
|
uuid = { version = "1.0", features = ["v4", "serde"] }
|
|
ts-rs = { workspace = true }
|
|
nix = { version = "0.29", features = ["signal", "process"] }
|
|
openssl-sys = { workspace = true }
|
|
rmcp = { version = "0.5.0", features = ["server", "transport-io"] }
|
|
schemars = { workspace = true }
|
|
secrecy = "0.10.3"
|
|
sentry = { version = "0.41.0", features = ["anyhow", "backtrace", "panic", "debug-images"] }
|
|
reqwest = { version = "0.12", features = ["json"] }
|
|
strip-ansi-escapes = "0.2.1"
|
|
thiserror = { workspace = true }
|
|
os_info = "3.12.0"
|
|
futures-util = "0.3"
|
|
ignore = "0.4"
|
|
git2 = "0.18"
|
|
mime_guess = "2.0"
|
|
rust-embed = "8.2"
|
|
url = "2.5"
|
|
rand = { version = "0.8", features = ["std"] }
|
|
sha2 = "0.10"
|
|
strum = "0.27.2"
|
|
regex = "1"
|
|
|
|
[build-dependencies]
|
|
dotenv = "0.15"
|