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

@tgm-research/agent-mcp

v0.2.1

Published

MCP stdio server for safe TGM Survey Platform agent workspaces.

Readme

TGM Agent MCP

@tgm-research/agent-mcp is a stdio MCP server for safe TGM Survey Platform agent workspaces.

It lets MCP clients such as Claude Desktop connect to a TGM Agent Gateway workspace without exposing broad survey CRUD. The package runs locally, speaks MCP over stdio, and forwards allowed tool/resource calls to the TGM backend endpoint:

POST /api/agent-workspaces/mcp
Authorization: Bearer <agent-token>

The backend remains the security boundary. This package does not implement business logic and does not grant extra permissions.

Install

Use directly with npx:

npx -y @tgm-research/agent-mcp --help

Or install globally:

npm install -g @tgm-research/agent-mcp
tgm-agent-mcp --help

Configuration

Required:

  • TGM_API_BASE_URL or --base-url: TGM API host, for example https://app.example.com or http://localhost:4088
  • TGM_AGENT_TOKEN or --token: short-lived token issued by POST /api/agent-workspaces/:workspaceId/tokens

Optional:

  • TGM_MCP_URL or --mcp-url: exact gateway MCP URL. Overrides TGM_API_BASE_URL.
  • TGM_AGENT_WORKSPACE_ID or --workspace-id: helps resource autocomplete and client display.
  • TGM_AGENT_TOKEN_FILE or --token-file: path to a file containing the token.
  • TGM_MCP_TIMEOUT_MS or --timeout-ms: backend request timeout. Defaults to 30000.

Claude Desktop Example

{
  "mcpServers": {
    "tgm-agent": {
      "command": "npx",
      "args": ["-y", "@tgm-research/agent-mcp"],
      "env": {
        "TGM_API_BASE_URL": "https://app.example.com",
        "TGM_AGENT_TOKEN": "tgm_agent_...",
        "TGM_AGENT_WORKSPACE_ID": "workspace-uuid"
      }
    }
  }
}

Do not paste the agent token into a normal chat prompt. Put it in the MCP client environment/configuration.

Exposed Tools

The local MCP server exposes the same safe tools as the backend gateway:

  • tgm_list_capabilities
  • tgm_get_question_type_schema
  • tgm_get_logic_schema
  • tgm_get_script_schema
  • tgm_get_snapshot
  • tgm_preview_patch
  • tgm_apply_patch_to_sandbox
  • tgm_validate_sandbox
  • tgm_create_preview_nonce
  • tgm_run_test_session
  • tgm_get_diff
  • tgm_request_human_review

There are intentionally no tools for delete, publish, raw SQL, raw respondent results, billing, organization management, users, or normal survey CRUD.

Resources

The package exposes the workspace-scoped TGM resources supported by the backend:

  • tgm://workspaces/{workspaceId}/snapshot
  • tgm://workspaces/{workspaceId}/capabilities
  • tgm://workspaces/{workspaceId}/diff
  • tgm://workspaces/{workspaceId}/validation
  • tgm://workspaces/{workspaceId}/test-runs

The backend validates that the bearer token can access only its own workspace.

Publish

Publishing requires npm access to the @tgm-research scope:

npm publish --workspace=@tgm-research/agent-mcp --access public