Skip to content

feat(mcp): add 7 inter-agent task management tools#74

Open
chitcommit wants to merge 1 commit intomainfrom
feat/task-management-mcp-tools
Open

feat(mcp): add 7 inter-agent task management tools#74
chitcommit wants to merge 1 commit intomainfrom
feat/task-management-mcp-tools

Conversation

@chitcommit
Copy link
Contributor

Summary

Adds a Task Management domain (domain 11, 7 tools) to the ChittyConnect MCP server at connect.chitty.cc/mcp, enabling any Claude session or ChittyAgent to coordinate work via tasks.chitty.cc.

  • chitty_task_create — create a task assigned to a named agent with optional priority, payload, and dependency chain
  • chitty_task_list — list/filter tasks by agent, status, task_type with pagination
  • chitty_task_get — get a specific task by ID (full detail including result)
  • chitty_task_claim — claim a pending task; sends X-ChittyOS-Caller header + ?agent= query param
  • chitty_task_complete — mark a task done with optional structured result payload
  • chitty_task_fail — mark a task failed with an error message
  • chitty_task_my_tasks — poll pending tasks for a named agent (GET /api/v1/tasks/agent/:name)

Implementation Details

Auth: Uses requireServiceAuth("chittytask", "ChittyTask") which resolves CHITTY_TASK_TOKEN from 1Password Connect (services/chittytask/service_token) with fallback to the CHITTY_TASK_TOKEN env var.

Read-only hints: chitty_task_list, chitty_task_get, chitty_task_my_tasks — no side effects.

Service registry: chittytask added to CHITTYOS_SERVICES so it appears in chitty_services_status health checks.

Canonical relationship: chittycanon://core/services/chittyconnect chittycanon://rel/connects-to chittycanon://core/services/chittytask

Secret to provision

Before deploying, set the service token:

wrangler secret put CHITTY_TASK_TOKEN
# Value: Bearer token accepted by tasks.chitty.cc

Test plan

  • npm test — all 227 existing tests pass
  • node --check — syntax validation clean on both modified files
  • Registry export verified: 59 total tools, 7 task tools, correct read-only classification
  • Deploy to staging and call chitty_task_list via MCP to confirm proxy round-trip
  • Set CHITTY_TASK_TOKEN secret and verify chitty_task_create + chitty_task_my_tasks

🤖 Generated with Claude Code

…tty.cc

Adds a new Task Management domain (domain 11) to the ChittyConnect MCP
server, enabling any Claude session or ChittyAgent to create, list, claim,
complete, and fail inter-agent tasks via the tasks.chitty.cc REST API.

Tools added:
- chitty_task_create   — create a task assigned to a specific agent
- chitty_task_list     — list/filter tasks by agent, status, task_type
- chitty_task_get      — retrieve a task by ID
- chitty_task_claim    — claim a pending task (sets X-ChittyOS-Caller header)
- chitty_task_complete — mark a task done with optional result payload
- chitty_task_fail     — mark a task failed with error message
- chitty_task_my_tasks — get pending tasks for a named agent (poll queue)

Auth: CHITTY_TASK_TOKEN service token via requireServiceAuth("chittytask").
Read-only hint set for list/get/my_tasks; write hint for create/claim/complete/fail.
chittytask added to CHITTYOS_SERVICES health-check list.

Canonical service: chittycanon://core/services/chittytask
Relationship: chittycanon://rel/connects-to → chittycanon://core/services/chittytask

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings March 17, 2026 03:14
@coderabbitai
Copy link

coderabbitai bot commented Mar 17, 2026

Warning

Rate limit exceeded

@chitcommit has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 25 minutes and 52 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 20efdf32-8e0a-49cf-84ad-e41a74205d38

📥 Commits

Reviewing files that changed from the base of the PR and between eb2a358 and f6820c0.

📒 Files selected for processing (3)
  • src/mcp/tool-dispatcher.js
  • src/mcp/tool-registry.js
  • wrangler.jsonc
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/task-management-mcp-tools
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@cloudflare-workers-and-pages
Copy link
Contributor

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
chittyconnect f6820c0 Mar 17 2026, 03:14 AM

@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@github-actions
Copy link
Contributor

⚠️ Unsigned Commits Detected

This PR contains unsigned commits. ChittyOS requires all commits to be cryptographically signed.

How to fix this:

Option 1: Sign with SSH key (Recommended)

# Configure Git to use SSH signing
git config --global gpg.format ssh
git config --global user.signingkey ~/.ssh/id_ed25519.pub
git config --global commit.gpgsign true

# Re-sign your commits
git rebase --exec 'git commit --amend --no-edit -S' HEAD~N
git push --force-with-lease

Option 2: Sign with 1Password

  1. Enable "Sign Git commits" in 1Password settings
  2. Configure Git: git config --global gpg.program /path/to/op-ssh-sign

Option 3: Sign with GPG

git config --global commit.gpgsign true
git config --global user.signingkey YOUR_KEY_ID

📚 1Password SSH Signing Guide

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds 7 inter-agent task management tools (domain 11) to the ChittyConnect MCP server, proxying requests to tasks.chitty.cc. Includes tool schema definitions, dispatch logic with service authentication, and service registry integration.

Changes:

  • Added 7 chitty_task_* tool definitions in the tool registry with JSON Schema input validation, and classified 3 as read-only
  • Added dispatch logic for all 7 tools in tool-dispatcher.js, using requireServiceAuth("chittytask", ...) and checkAndParseJson consistent with existing patterns
  • Registered chittytask in CHITTYOS_SERVICES and documented CHITTY_TASK_TOKEN in wrangler.jsonc

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
wrangler.jsonc Documents CHITTY_TASK_TOKEN secret in the secrets comment block
src/mcp/tool-registry.js Adds 7 task management tool schemas and marks 3 as read-only; updates domain count comment
src/mcp/tool-dispatcher.js Adds chittytask to service registry and implements dispatch for all 7 task tools

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +1465 to +1469
const claimHeaders = { ...taskAuth };
if (args.agent) claimHeaders["X-ChittyOS-Caller"] = args.agent;
const url = args.agent
? `https://tasks.chitty.cc/api/v1/tasks/${encodeURIComponent(args.task_id)}/claim?agent=${encodeURIComponent(args.agent)}`
: `https://tasks.chitty.cc/api/v1/tasks/${encodeURIComponent(args.task_id)}/claim`;
Comment on lines +1393 to +1561
else if (name.startsWith("chitty_task_")) {
const { error: taskErr, headers: taskAuth } = await requireServiceAuth(
"chittytask",
"ChittyTask",
);
if (taskErr) return taskErr;
const taskHeaders = { ...taskAuth, "Content-Type": "application/json" };

if (name === "chitty_task_create") {
const body = {
title: args.title,
task_type: args.task_type,
assigned_agent: args.assigned_agent,
};
if (args.description !== undefined) body.description = args.description;
if (args.priority !== undefined) body.priority = args.priority;
if (args.payload !== undefined) body.payload = args.payload;
if (args.depends_on !== undefined) body.depends_on = args.depends_on;
const response = await fetch("https://tasks.chitty.cc/api/v1/tasks", {
method: "POST",
headers: taskHeaders,
body: JSON.stringify(body),
});
const { data, error: respErr } = await checkAndParseJson(
response,
"ChittyTask",
);
if (respErr) return respErr;
result = data;
} else if (name === "chitty_task_list") {
const params = new URLSearchParams();
if (args.agent) params.set("agent", args.agent);
if (args.status) params.set("status", args.status);
if (args.task_type) params.set("task_type", args.task_type);
if (args.limit !== undefined) params.set("limit", String(args.limit));
if (args.offset !== undefined) params.set("offset", String(args.offset));
const url = `https://tasks.chitty.cc/api/v1/tasks${params.toString() ? `?${params}` : ""}`;
const response = await fetch(url, { headers: taskAuth });
const { data, error: respErr } = await checkAndParseJson(
response,
"ChittyTask",
);
if (respErr) return respErr;
result = data;
} else if (name === "chitty_task_get") {
if (!args.task_id) {
return {
content: [
{ type: "text", text: "Missing required parameter: task_id" },
],
isError: true,
};
}
const response = await fetch(
`https://tasks.chitty.cc/api/v1/tasks/${encodeURIComponent(args.task_id)}`,
{ headers: taskAuth },
);
const { data, error: respErr } = await checkAndParseJson(
response,
"ChittyTask",
);
if (respErr) return respErr;
result = data;
} else if (name === "chitty_task_claim") {
if (!args.task_id) {
return {
content: [
{ type: "text", text: "Missing required parameter: task_id" },
],
isError: true,
};
}
const claimHeaders = { ...taskAuth };
if (args.agent) claimHeaders["X-ChittyOS-Caller"] = args.agent;
const url = args.agent
? `https://tasks.chitty.cc/api/v1/tasks/${encodeURIComponent(args.task_id)}/claim?agent=${encodeURIComponent(args.agent)}`
: `https://tasks.chitty.cc/api/v1/tasks/${encodeURIComponent(args.task_id)}/claim`;
const response = await fetch(url, {
method: "POST",
headers: claimHeaders,
});
const { data, error: respErr } = await checkAndParseJson(
response,
"ChittyTask",
);
if (respErr) return respErr;
result = data;
} else if (name === "chitty_task_complete") {
if (!args.task_id) {
return {
content: [
{ type: "text", text: "Missing required parameter: task_id" },
],
isError: true,
};
}
const body = {};
if (args.result !== undefined) body.result = args.result;
const response = await fetch(
`https://tasks.chitty.cc/api/v1/tasks/${encodeURIComponent(args.task_id)}/complete`,
{
method: "POST",
headers: taskHeaders,
body: JSON.stringify(body),
},
);
const { data, error: respErr } = await checkAndParseJson(
response,
"ChittyTask",
);
if (respErr) return respErr;
result = data;
} else if (name === "chitty_task_fail") {
if (!args.task_id) {
return {
content: [
{ type: "text", text: "Missing required parameter: task_id" },
],
isError: true,
};
}
if (!args.error) {
return {
content: [
{ type: "text", text: "Missing required parameter: error" },
],
isError: true,
};
}
const response = await fetch(
`https://tasks.chitty.cc/api/v1/tasks/${encodeURIComponent(args.task_id)}/fail`,
{
method: "POST",
headers: taskHeaders,
body: JSON.stringify({ error: args.error }),
},
);
const { data, error: respErr } = await checkAndParseJson(
response,
"ChittyTask",
);
if (respErr) return respErr;
result = data;
} else if (name === "chitty_task_my_tasks") {
if (!args.agent) {
return {
content: [
{ type: "text", text: "Missing required parameter: agent" },
],
isError: true,
};
}
const response = await fetch(
`https://tasks.chitty.cc/api/v1/tasks/agent/${encodeURIComponent(args.agent)}`,
{ headers: taskAuth },
);
const { data, error: respErr } = await checkAndParseJson(
response,
"ChittyTask",
);
if (respErr) return respErr;
result = data;
} else {
return {
content: [{ type: "text", text: `Unknown task tool: ${name}` }],
isError: true,
};
}
}
@chitcommit chitcommit enabled auto-merge March 17, 2026 03:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants