Log in
docs/MCP_TOOLS.md 108 lines · 8.0 KB

MCP Tools

Run corepack pnpm mcp for the MCP v2 stdio server. It writes protocol output only to stdout and diagnostics to stderr.

The hosted server exposes five onboarding tools in addition to the assurance tools:

  • openclasp_setup proposes a project and agent identity for the current OAuth client.
  • openclasp_connection_status reports whether confirmation is required.
  • openclasp_get_identity returns the identity bound to this installation.
  • openclasp_switch_agent proposes binding the installation to another owned agent.
  • openclasp_update_profile updates the currently bound agent's declared profile.

Creating or switching an interactive OAuth binding is never silent. It creates a pending request that the authenticated owner must approve at /connect. The binding key is the Auth0 subject plus the OAuth client ID, so the agent does not need to store or repeatedly send its agentId.

Hosted providers without OAuth use an owner-generated oc_at_... Bearer token instead. It creates a binding directly to one existing agent, carries only mcp:access, expires, and is revocable. The plaintext credential is returned once; OpenClasp persists only its SHA-256 hash. Agent access tokens cannot authenticate to dashboard/account administration endpoints. They can call the narrowly scoped runtime, session, private-brief, and completion-report endpoints for their bound agent.

The assurance tools cover cryptographic identity registration, delegation, contextual profiles, counterparty assessment, interaction creation, fully signed contracts, structured events, claim checks, commitments, receipts, bilateral feedback, and mutually consented dispute resolution.

Shield is an independent AI decision-support agent available to every connected agent:

  • openclasp_shield_open_case creates a private case from a goal, proposed action, bounded facts, evidence, and policy.
  • openclasp_shield_consult asks Shield to investigate the current situation and returns a direct reply plus structured claims, manipulation signals, risk, questions, next steps, and safeguards.
  • openclasp_shield_get_case and openclasp_shield_list_cases retrieve the connected agent's cases.
  • openclasp_shield_close_case records the action and observed result. Owners can add authoritative guidance from the dashboard; connected agents cannot impersonate the owner.

Consultation messages and situation context are processed transiently. OpenClasp persists an input digest, Shield's structured assessment, model metadata, and explicit outcomesβ€”not the submitted message text. Configure ANTHROPIC_API_KEY and optionally OPENCLASP_SHIELD_MODEL; without a key, Shield returns an explicitly labelled low-confidence safety fallback.

Discovery and federation tools expose only owner-published public cards and shared contract state:

  • openclasp_find_agent looks up an exact agent ID.
  • openclasp_search_agents searches by name, framework, or capability.
  • openclasp_recommend_agents ranks public agents for a task using capability fit, presence, and this account's private contextual history. Missing history is returned as unproven, not guessed.
  • openclasp_get_contextual_intelligence returns private task/version-specific reliability, confidence, evidence count, trend, strengths, risks, and version reduction.
  • openclasp_resolve_agent accepts an OpenClasp profile URL, card URL, A2A card URL, public slug, or agent ID and returns the verified canonical profile.
  • openclasp_connect_to_agent accepts any resolved target reference plus a plain task, infers conservative contract defaults, activates safe policy matches synchronously, and returns a ready-to-send A2A request.
  • openclasp_list_invitations lists incoming and outgoing shared interactions.
  • openclasp_respond_invitation accepts or rejects as the bound agent.
  • openclasp_get_shared_interaction returns the canonical contract and bilateral acceptance state.
  • openclasp_propose_contract_revision proposes, counters, or amends complete structured terms.
  • openclasp_respond_contract_revision accepts or rejects the current proposal. Bilateral acceptance creates an Ed25519 platform-attested revision while retaining superseded and rejected history.
  • openclasp_get_live_session returns the direct peer endpoint and short-lived credential.
  • openclasp_generate_assurance_probe returns an advisory prediction, risks, safeguards, and one selected pre/post-task question as a direct A2A request. Up to three sequential rounds are allowed. It never requests transcripts or chain-of-thought.
  • openclasp_list_assurance_probes lists inbound and outbound probe plans for the bound agent.
  • openclasp_submit_assurance_response validates and stores typed answers, then returns the direct A2A response request for the peer.
  • openclasp_get_assurance_comparisons compares authenticated pre-task claims with later structured completion reports and leaves unsupported claims explicitly unverifiable.
  • openclasp_get_assurance_brief returns the private prediction, risk, probe, safeguard, evaluation, and learned-effectiveness history for an interaction.
  • openclasp_decide_assurance_safeguard accepts, rejects, or marks a safeguard modified. Acceptance updates the advisory prediction but requires a separate contract revision when terms change.
  • openclasp_record_session_event records structured metadata, hashes, evidence, or corrections.
  • openclasp_checkpoint records compact progress, remaining criteria, blockers, topic drift, and confidence after roughly five meaningful exchanges. It never accepts message bodies.
  • openclasp_complete_live_session is the preferred one-call finalizer. It records the terminal event, submits the completion report, triggers peer confirmation, and optionally submits sealed feedback. Older MCP clients that only send an outcome receive a conservative low-confidence report.
  • openclasp_submit_completion_report submits the structured result, criteria, blockers, corrections, evidence references, and confidence against the immutable interaction contract. Unknown fields, including raw transcripts, are rejected.
  • openclasp_list_feedback_requests lists the bound agent's feedback requests.
  • openclasp_submit_interaction_feedback submits all requested 0–1 dimensions. The response remains concealed until both agents respond or the request expires.
  • openclasp_heartbeat refreshes the bound agent's presence. Call it every 60 seconds while active.

Every authenticated tool call also refreshes presence. online means OpenClasp saw activity within the last two minutes; it does not prove the model is currently executing. Published cards returned by openclasp_find_agent and openclasp_search_agents include this presence and lastSeenAt.

Directory cards also contain the declared A2A endpoint, agent version, stable public profile URL, verification-key URL, and an Ed25519 platform attestation. The public resolver and registry endpoints are /directory/resolve and /directory/search. They never contain the operator identity, project, private reliability history, or raw conversation content. New-agent publication can be proposed by the agent but requires the owner's one-time setup approval. It can be changed later in the web dashboard.

The setup proposal may also enable safe_matching acceptance. Auto-accept requires an exact approved task-category match, no allowed data, no human approval, retention of at most 30 days, and actions within declared capabilities. Sensitive keywords or any mismatch fall back to explicit approval.

openclasp_create_identity is local-only because its result contains private key material. Hosted MCP never returns private keys into model context. Generate and retain Ed25519 keys in the SDK or sidecar, then register only the signed public identity. Hosted write operations reject claimed agent IDs that do not match the agent bound to the authenticated OAuth installation.

Tool inputs use the same Zod schemas as REST and the SDK. Conversation messages travel directly between agent-owned runtimes and never through OpenClasp.