Skip to content

feat: support AGENTA_SIGNER env var in MCP server#4

Open
PancheI wants to merge 1 commit intomainfrom
feat/mcp-signer-name-config
Open

feat: support AGENTA_SIGNER env var in MCP server#4
PancheI wants to merge 1 commit intomainfrom
feat/mcp-signer-name-config

Conversation

@PancheI
Copy link
Contributor

@PancheI PancheI commented Mar 5, 2026

Summary

  • Add AGENTA_SIGNER env var support to MCP server's SignerManager
  • When set, loads credentials from ~/.agenta/signers/{name}.json (same as CLI)
  • Falls back to AGENTA_API_KEY + AGENTA_API_SECRET for CI/Docker/remote
  • Clear error message when neither path is configured

Why

The MCP server currently requires the signer share as a plaintext env var in the MCP client config. This puts MPC key material in a JSON file that's readable on disk and can end up in AI conversation logs — undermining the security model of threshold signing.

With AGENTA_SIGNER, the config file contains only a name reference. The share is loaded from ~/.agenta/ at runtime (encrypted, or in macOS keychain with Touch ID).

MCP config (before → after)

Before (only option):

{
  "env": {
    "AGENTA_API_KEY": "gw_live_...",
    "AGENTA_API_SECRET": "base64-encoded-share..."
  }
}

After (recommended for local dev):

{
  "env": {
    "AGENTA_SIGNER": "my-agent"
  }
}

Impact

  • Only touches packages/wallet/src/lib/signer-manager.ts
  • No changes to CLI, SDK, MCP tools, or signing protocol
  • Existing AGENTA_API_KEY + AGENTA_API_SECRET path still works unchanged
  • AGENTA_SIGNER takes precedence when set

Closes #3

Test plan

  • TypeScript compiles cleanly
  • All existing tests pass (build + test via pre-push hook)
  • Manual: set AGENTA_SIGNER=<name> in Claude Desktop config, verify tools work
  • Manual: verify AGENTA_API_KEY + AGENTA_API_SECRET still works
  • Manual: verify error message when neither is set

Add a second credential path for the MCP server. When AGENTA_SIGNER
is set, load config from ~/.agenta/signers/{name}.json instead of
requiring AGENTA_API_KEY and AGENTA_API_SECRET as direct env vars.

This keeps the signer share out of the MCP client config file,
improving security for local development with Claude Desktop, Cursor,
and other MCP clients.

AGENTA_SIGNER takes precedence. Falls back to direct env vars for
CI/CD, Docker, and remote agent deployments.

Closes #3
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.

feat: support AGENTA_SIGNER env var in MCP server for local signer config

1 participant