npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

agent-mcp-adapter

v0.1.1

Published

MCP adapter that exposes XAgent HTTP APIs as non-invasive MCP tools.

Readme

agent-mcp-adapter

Non-invasive MCP adapter for XAgent HTTP APIs.

The adapter runs as a separate MCP stdio server and calls XAgent through its public HTTP API. It does not import XAgent internals, read the database, or bypass auth/owner scope.

Configuration

$env:XAGENT_BASE_URL = "http://127.0.0.1:3000"

# Optional. Forward auth exactly like a normal HTTP client.
$env:XAGENT_AUTHORIZATION = "Bearer <token>"

# Optional JSON object for extra headers.
$env:XAGENT_HEADERS_JSON = '{"x-tenant-id":"tenant-1"}'

# Optional request timeout.
$env:XAGENT_TIMEOUT_MS = "30000"

# Safety default: only read-only tools are exposed unless this is set to false.
$env:XAGENT_MCP_READONLY = "true"

# Optional comma-separated allowlist. Applied together with read-only filtering.
$env:XAGENT_MCP_ALLOWED_TOOLS = "xagent_health,xagent_list_sessions"

# Optional comma-separated response header allowlist. Headers are hidden by default.
$env:XAGENT_RESPONSE_HEADER_ALLOWLIST = "x-request-id"

Run

From npm:

npx agent-mcp-adapter

For local development:

npm install
npm run build
npm start

Drift Check

Set XAGENT_ROUTES_FILE to the target agent route source file, then verify that the adapter still covers the current public routes:

$env:XAGENT_ROUTES_FILE = "C:\path\to\agent-repo\packages\agent-channel-web\src\routes\requests.ts"
npm run check:xagent-routes

Design

  • Every tool maps to a public XAgent route.
  • Tool input is converted into HTTP path/query/body.
  • Tool input is validated by the adapter before any upstream HTTP call.
  • Tool output includes structuredContent with status, ok, body, and request metadata.
  • Response headers are hidden unless explicitly allowlisted.
  • The default exposure mode is read-only; mutation tools require XAGENT_MCP_READONLY=false.
  • SSE/WebSocket streaming is represented by a polling tool, xagent_wait_for_session_idle.
  • Multipart submit/edit routes are exposed through explicit base64 file upload tools.

Included API Tools

  • xagent_health
  • xagent_health_deep
  • xagent_runtime_bootstrap
  • xagent_list_sessions
  • xagent_create_session
  • xagent_update_session_title
  • xagent_list_skills
  • xagent_generate_suggested_questions
  • xagent_get_conversation_preview
  • xagent_get_conversation
  • xagent_submit_request
  • xagent_submit_request_multipart
  • xagent_submit_session_request
  • xagent_submit_session_request_multipart
  • xagent_cancel_session
  • xagent_retry_session
  • xagent_edit_latest_request
  • xagent_edit_latest_request_multipart
  • xagent_answer_pending_input
  • xagent_upsert_run_annotation
  • xagent_list_favorites
  • xagent_list_session_annotations
  • xagent_create_share
  • xagent_get_shared_conversation
  • xagent_wait_for_session_idle

Multipart Input

Multipart tools accept base64 file content:

{
  "body": {
    "inputText": "Inspect this alarm file.",
    "idempotencyKey": "idem-1",
    "files": [
      {
        "fileName": "alarm.txt",
        "declaredMimeType": "text/plain",
        "base64": "YWxhcm0="
      }
    ]
  }
}

Exposing Write Tools

To expose all built-in tools:

$env:XAGENT_MCP_READONLY = "false"

To expose only a narrow set:

$env:XAGENT_MCP_READONLY = "false"
$env:XAGENT_MCP_ALLOWED_TOOLS = "xagent_submit_request,xagent_get_conversation,xagent_wait_for_session_idle"