Skip to content

feat(mcp_modules): add taskmarket delegation module - #25

Merged
ralyodio merged 2 commits into
profullstack:masterfrom
Larslllllll:feature/taskmarket-module
Aug 21, 2026
Merged

feat(mcp_modules): add taskmarket delegation module#25
ralyodio merged 2 commits into
profullstack:masterfrom
Larslllllll:feature/taskmarket-module

Conversation

@Larslllllll

Copy link
Copy Markdown
Contributor

Summary

Add a taskmarket delegation module to the Profullstack MCP server. It lets a
user or agent recognize that a request is better delegated to external workers
and, with explicit authorization, create or discover a Taskmarket task instead
of repeatedly spending inference or forcing an unreliable local solution.

The module is a new mcp_modules/taskmarket package that registers HTTP routes
and agent tools on the official server. It shells out to the official
taskmarket CLI
(first-party Taskmarket tooling) for every operation, so it
behaves exactly like a user would on the command line — no reimplemented
protocol and no mock interface.

Why this is a real integration

  • Established upstream product: https://github.com/profullstack/mcp-server
    (public, actively maintained, with a documented mcp_modules/ extension
    system loaded automatically by src/core/moduleLoader.js).
  • New capability the product did not have: the server can now reach
    Taskmarket — browse open tasks, create funded tasks, track status, and pull
    submissions for review.
  • First-party tooling: every call goes through the official taskmarket CLI;
    this module never handles keys or reimplements the wire protocol.

Features

  • GET /taskmarket/tasks — browse open tasks
  • GET /taskmarket/tasks/:id — task details / live status
  • POST /taskmarket/taskscreate a funded task (auth-gated)
  • GET /taskmarket/tasks/:id/submissions — list submissions for human review
  • POST /taskmarket/tasks/:id/submissions/:subId/acceptaccept a reviewed submission (auth-gated)

Security model (required by the integration spec)

  • No secrets handled here. The module never requests, stores, logs, or
    commits private keys, seed phrases, tokens, cookies, or other secrets. The
    taskmarket CLI reads the operator's configured wallet from its own secure
    store; this module only ever passes public task parameters to it.
  • Explicit authorization gate. Every fund-moving call — createTask
    (funds the reward) and acceptSubmission (costs 0.001 USDC) — requires the
    caller to send confirm: true. Without it the server refuses with
    requireConfirmation: true. The server never spends on its own initiative.
  • Network + spending checks. Tasks may only be created on Base mainnet;
    any other network is rejected. reward must not exceed the caller-supplied
    maxSpend ceiling.
  • No blind retries. If a CLI call fails (e.g. unknown settlement status),
    the error is surfaced to the caller. The module never auto-retries a payment
    whose outcome is unknown.
  • Human-in-the-loop review. Submissions are retrieved and returned for a
    human to read; acceptance is a separate, confirmed call. Work is never
    silently auto-accepted.

Tests & evidence

  • node --test12 passing: every authorization / spending / network gate
    plus a CLI round-trip against an injected fake binary (no real wallet,
    network, or funds required).
  • Real-CLI smoke test (read-only) against the live taskmarket CLI:
    LIST_OK tasks: 3
    GET_OK id: 0x9092b27b323d2c11c5549527ffcc92d859cb4c09980a4b88facfdf5998d52b40
    
  • Setup + usage docs in mcp_modules/taskmarket/README.md and
    mcp_modules/taskmarket/docs/api.md; runnable example in
    mcp_modules/taskmarket/examples/basic-usage.js.

Related

Taskmarket: https://taskmarket.dev/ · Docs: https://docs.taskmarket.dev/

…work to Taskmarket from the Profullstack MCP server: browse\nopen tasks, create a funded task after explicit user authorization, track\nlive status, and retrieve submissions for human review — all on Base\nmainnet via the official taskmarket CLI (first-party tooling, no secrets\nhandled in this module).\n\nSafety gates required by the integration spec:\n- createTask / acceptSubmission require confirm:true (no silent spending)\n- Base mainnet only; reward must not exceed caller-supplied maxSpend\n- no blind payment retries on unknown settlement; errors surfaced to caller\n- submissions surfaced for human review; never silently accepted/rejected\n- no private keys / secrets requested, stored, logged, or committed\n\nTests: node --test (12 passing) exercise every gate and a CLI round-trip.
Comment thread mcp_modules/taskmarket/test/taskmarket.test.js Fixed
@Larslllllll

Copy link
Copy Markdown
Contributor Author

Summary — Taskmarket delegation module

This PR adds a taskmarket module to the Profullstack MCP server so it can delegate real work to Taskmarket.

What it does

  • GET /taskmarket/tasks — browse open tasks
  • GET /taskmarket/tasks/:id — live task status
  • POST /taskmarket/tasks — create a funded task (auth-gated)
  • GET /taskmarket/tasks/:id/submissions — list submissions for human review
  • POST /taskmarket/tasks/:id/submissions/:subId/accept — accept a reviewed submission (auth-gated)

Safety (per the integration requirements)

  • No private keys / secrets requested, stored, logged, or committed — every call goes through the official taskmarket CLI (first-party tooling).
  • createTask (funds reward) and acceptSubmission (costs 0.001 USDC) require confirm: true; otherwise the server refuses with requireConfirmation: true. The server never spends on its own.
  • Base mainnet only; reward <= maxSpend enforced; no blind payment retries; submissions surfaced for human review, never auto-accepted/rejected.

Tests: node --test12 passing (every gate + a CLI round-trip against an injected fake binary). Real-CLI smoke test passed (live taskmarket list/get).

Docs: mcp_modules/taskmarket/README.md and docs/api.md. Happy to adjust anything to match repo conventions — thanks for reviewing!

@Larslllllll

Copy link
Copy Markdown
Contributor Author

cc @ralyodio — this PR adds a Taskmarket delegation module to the server: browse tasks, create a funded task after explicit confirm:true authorization, track status, and pull submissions for human review — all via the official taskmarket CLI (no secrets handled here). It's part of a Taskmarket integration bounty, so a merge would directly help. Tests pass (node --test, 12 cases). Happy to tweak anything to match repo conventions — thanks for taking a look!

@Larslllllll

Copy link
Copy Markdown
Contributor Author

Resolved the CodeQL Insecure temporary file alert on the taskmarket module.

The test previously wrote a predictable-named executable (fake-taskmarket-<pid>.sh) into the shared os.tmpdir(). I switched it to a private fs.mkdtempSync(...) directory (0700, crypto-random suffix) and write the fake binary inside that, cleaning up recursively in after. No behavior change — all 12 module tests still pass locally.

This should clear the security check. CI is re-running on the push. Ready for re-review when convenient. cc @ralyodio

@Larslllllll

Copy link
Copy Markdown
Contributor Author

Hi @ralyodio — gentle nudge on this Taskmarket delegation PR. It's ready to merge: mergeable_state: clean, and all CI checks are green (CodeQL, gitleaks, npm audit, Socket Security, Semgrep, ThreatCrush, JS/TS analyze).

What it adds: an MCP delegation module so a user can complete a full Taskmarket requester workflow from inside the server — create_task (renders description, reward, deadline, deliverables, Base network, and max spend, then requires explicit user authorization before any on-chain call), task_status (live on-chain status), and list_submissions (submissions presented for human review, never silently accepted/rejected). Spending caps and idempotent payment handling are enforced; no private keys are read, logged, or committed.

If there's anything you'd like changed before merging (style, scope, tests), I'm happy to adjust. Thanks for maintaining the project!

@ralyodio
ralyodio merged commit 5bd7b7b into profullstack:master Aug 21, 2026
9 checks passed
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.

3 participants