Skip to main content
Glama

advocatehub-mcp

A Model Context Protocol server for Influitive AdvocateHub, built entirely on the public Influitive REST API (api.influitive.com / api.influitives.com in staging). This is Phase 1: no hub source changes, no internal endpoints — everything here is something any AdvocateHub customer could build against their own API token.

What it does

55 org-token tools (members, groups, challenges, events, rewards, approvals, referrals, references, webhooks, messages, integrations, and more) plus 25 individual-user SSO / JWT self-service tools (sso_login, whoami, sso_logout, and 22 my_* tools covering profile, groups, challenges, rewards, activity, notifications, badges/achievements, and social auth). Org-token writes are confirm-gated and audit-logged; SSO tools sign a human into their own hub account via a real browser and call the hub as them, separate from the org-wide API token.

Tool surface (HTTP-first): streamable HTTP defaults to the gateway surface (~20 category tools). Set header X-Advocatehub-Tool-Surface: granular for the full ~83 granular catalog (e.g. Cursor). Claude Desktop is auto-detected from MCP initialize clientInfo. Stdio defaults to granular unless ADVOCATEHUB_TOOL_SURFACE=gateway. See docs/tool-reference.md for gateway actions and docs/setup-claude.md for setup.

Related MCP server: hubspot-mcp

Status

  • P1a (stdio, for Claude Desktop/Code): done. See docs/setup-claude.md.

  • P1b (streamable HTTP, for ChatGPT / remote clients): done, needs a staging smoke pass. See docs/setup-chatgpt.md.

  • Individual-user SSO/JWT self-service (sso_login/whoami/sso_logout + 22 my_* tools, see src/tools/myAccount.ts and src/tools/sso.ts): done for stdio only. See docs/setup-sso.md. Not yet available on the streamable HTTP transport.

  • Target environment so far: staging (https://api.influitives.com). Production support is a config change (X-Influitive-Base-Url header or INFLUITIVE_BASE_URL env var to https://api.influitive.com) — re-run the staging smoke checklist against production before trusting it there.

Optimization roadmap

File-grounded improvement plans by credential model:

See also JWT_INDIVIDUAL_USER_AUTH_CAPABILITY_MATRIX.md for what each credential can and cannot do today.

npm install
npm run build
npm run start:http            # listens on PORT (default 8787), no credentials needed

Point your MCP client at http://localhost:8787/mcp with per-connection headers:

{
  "mcpServers": {
    "advocatehub": {
      "type": "http",
      "url": "http://localhost:8787/mcp",
      "headers": {
        "Authorization": "Bearer <INFLUITIVE_API_TOKEN>",
        "X-Influitive-Org-Id": "<ORG_ID>",
        "X-Influitive-Base-Url": "https://api.influitives.com"
      }
    }
  }
}

See docs/setup-claude.md and docs/setup-chatgpt.md for Claude Desktop, Claude Code (claude mcp add --transport http), and ChatGPT setup. See docs/usage-guide.md for credential modes and which tools each auth type exposes.

Quick start (stdio)

npm install
npm run build
npm run start      # or point your client's config at dist/src/index.js

Supply credentials via client env vars (INFLUITIVE_API_TOKEN, INFLUITIVE_ORG_ID) or call the configure_tenant tool at session start. No .env file or setup wizard required.

Hybrid mode (org token + SSO on one machine)

Use stdio transport and configure both credentials:

# Org-wide integration bot (required for admin tools)
INFLUITIVE_BASE_URL=https://api.influitives.com
INFLUITIVE_API_TOKEN=<from hub Admin -> Integrations -> Influitive API>
INFLUITIVE_ORG_ID=<numeric org id>

# Individual-user SSO (required for sso_login / whoami / my_* tools)
INFLUITIVE_HUB_URL=https://yourhub.influitives.com

Or pass hub_url to configure_tenant alongside api_token and org_id.

After configuration, run sso_login once interactively to seed the browser profile. SSO tools do not work on streamable HTTP — see docs/setup-sso.md and docs/optimization-plan-hybrid.md.

Development

npm run dev            # tsx watch, stdio
npm run dev:http       # tsx watch, streamable HTTP
npm test               # unit tests (mocked fetch, no network)
npm run test:integration  # opt-in, hits real staging — see .env.example
npm run lint
npm run typecheck

Repo layout

src/
  index.ts            stdio entrypoint (P1a)
  http.ts             streamable HTTP entrypoint (P1b)
  server.ts           builds the McpServer and registers all tools
  config/             tenant session, HTTP header resolution, env bootstrap, SSO session cache
  client/             InfluitiveClient: auth headers, retries, cursor pagination, rate limiting
  auth/               HubSsoClient: Playwright-driven individual-user SSO login (see docs/setup-sso.md)
  errors/             typed error classes + HTTP status -> error mapping
  registry/           local per-tenant index of challenges this server has created
  audit/              append-only JSONL write audit log (monthly rotation)
  tools/              ~55 org-token tools + configure_tenant + 25 SSO/JWT self-service tools
test/
  unit/               fast tests, fetch mocked, no network
  integration/        opt-in, mutates a real (disposable) staging tenant
docs/                  setup guides, usage guide, tool reference

Design notes worth knowing before you touch this

  • Plug-and-play credentials: the server starts unconfigured. HTTP clients pass Authorization, X-Influitive-Org-Id, and optionally X-Influitive-Base-Url per connection. Stdio clients use env vars or configure_tenant at runtime.

  • Write safety: every write tool takes a confirm flag. confirm:false (or omitted) only previews — it never calls the API. confirm:true executes and always appends exactly one entry to the per-tenant audit log (~/.advocatehub-mcp/audit/<orgId>-YYYY-MM.jsonl, with legacy <orgId>.jsonl still read), whether it succeeded or failed. See src/tools/shared/confirmGate.ts.

  • No raw exceptions cross the MCP boundary. Every tool handler is wrapped so typed errors (AuthError, NotFoundError, ...) come back as { isError: true } text, never an unhandled throw. See src/tools/shared/formatters.ts.

  • The public API has no "list challenges" endpoint. ChallengeRegistry (src/registry/challengeRegistry.ts) is a local, best-effort index of challenges this server created — it does not know about challenges created any other way, and is lost if ~/.advocatehub-mcp is wiped.

  • contacts_api_search is a per-tenant Labs flag. If it's off, /contacts silently ignores filters instead of erroring. search_members refuses filtered queries once it knows the flag is off (config.contactsSearchEnabled === false), and self-heals that cache the first time it sees evidence either way. See src/tools/members.ts.

  • Locking a member is seat reclaim, per current product policy: it blocks login and excludes the member from advocate counts, targeting, and the billable seat count. deactivate_member/reactivate_member describe this explicitly in their tool descriptions so an LLM doesn't undersell what the action does.

Available Tools

5 tools
audit_tailA
Read-only

Return the last N executed write audit entries for this tenant from ~/.advocatehub-mcp/audit/-YYYY-MM.jsonl (and legacy .jsonl if present). Only confirm:true writes are logged; previews are excluded.

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNoNumber of most recent audit entries to return (max 500).

TDQS

A4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true and destructiveHint=false, so the bar is lower. The description adds meaningful behavior beyond annotations: it specifies the exact file location, the fact that only confirm:true writes are logged, and that previews are excluded. This gives the agent useful expectation about data availability.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences and front-loaded with the main purpose. Every piece of information (file path, filtering rule) is relevant and efficiently communicated without redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

There is no output schema, so the description could have explained the structure of each audit entry. It does specify the source file and filtering, but not the fields of the returned entries. Overall, this is reasonably complete for a simple tail tool with good annotations, but a short note on output format would have made it complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The only parameter 'limit' is fully described in the input schema with a default, range, and description, so schema coverage is 100%. The tool description itself does not add extra parameter semantics, but with full schema coverage, the baseline of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states a specific action (Return), a specific resource (write audit entries), and the scope (last N for this tenant, from a specific file path). It also distinguishes from the sibling audit_search by implying a tail operation rather than a search.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies the tool is used to retrieve recent confirmed write audit entries, but it does not explicitly mention when to choose this over audit_search or other siblings. The note about 'confirm:true' and previews exclusion provides some context but no direct usage alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

configure_tenantConfigure AdvocateHub tenant credentialsA

Supplies org-wide API credentials (api_token + org_id) and/or hub_url for SSO. Required before other tools when the server started unconfigured. Org-token tools need api_token + org_id; SSO-only sessions need only hub_url (org id is derived from the JWT after sso_login).

ParametersJSON Schema
NameRequiredDescriptionDefault
org_idNoNumeric organization id (X_ORG_ID). Required with api_token.
hub_urlNoHub web app origin for SSO tools (e.g. https://yourhub.influitives.com).
base_urlNoREST API origin (default: https://api.influitives.com).
validateNoWhen true (default), validates org credentials via GET /api/members/me when api_token is supplied.
api_tokenNoNarci API token from hub Admin → Integrations → Influitive API. Optional for SSO-only.

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=false and destructiveHint=false. The description adds behavioral context by explaining the precondition ('Required before other tools') and the validation behavior via the 'validate' parameter. It does not disclose all side effects (e.g., whether credentials are persisted), but it goes beyond what annotations alone provide.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three sentences, front-loaded with the core purpose, then prerequisites, then parameter-mode rules. No fluff; every sentence serves a distinct purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (5 params, no output schema), the description covers the main modes, a prerequisite, and validation behavior. It does not describe return values, but that is less critical for a setup tool. The schema already documents all parameters, so the description is appropriately complementary.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3. The description elevates this by explaining the semantic relationships between parameters: 'Org-token tools need api_token + org_id; SSO-only sessions need only hub_url (org id is derived from the JWT after sso_login).' This is meaningful guidance not present in the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's verb and resource: 'Supplies org-wide API credentials (api_token + org_id) and/or hub_url for SSO.' It also distinguishes itself from siblings by framing itself as a prerequisite setup tool, distinct from listing, auditing, and identity-context tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly says when to use the tool: 'Required before other tools when the server started unconfigured.' It also provides mode-specific guidance (org-token vs. SSO-only). However, it does not explicitly state when NOT to use it or mention alternative tools, falling short of the '5' bar for explicit exclusions/alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_active_identity_contextGet active org-token and SSO identity contextA
Read-only

Reports which credentials are active in this MCP session: org-wide API token (when configured) and individual-user SSO (when hub_url is set or after sso_login). Call before choosing org-token admin tools vs my_* / SSO self-service tools.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.7/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true and destructiveHint=false, but the description adds valuable context about what credentials are checked (org-wide token, SSO) and under what conditions they are active (when configured, hub_url set, or after sso_login). This goes beyond the structured annotations without contradicting them.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences, front-loaded with the core purpose ('Reports which credentials are active'), followed by specific conditions. Every sentence is information-dense with no filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple zero-parameter status tool with no output schema, the description provides sufficient context: what it reports, the credential types and conditions, and when to use it. It doesn't leave the agent guessing about its role in the toolset.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters, so schema coverage is trivially 100%. The baseline for no parameters is 4, and the description appropriately includes no parameter details since none exist.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses the specific verb 'Reports' and identifies the resource as 'which credentials are active in this MCP session'. It clearly distinguishes from sibling tools like audit_search or configure_tenant, which serve different purposes.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It explicitly states when to call: 'Call before choosing org-token admin tools vs my_* / SSO self-service tools.' This gives the agent a direct usage directive and clarifies the decision it helps make.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_advocatehub_toolsList all AdvocateHub MCP toolsA
Read-only

Returns the complete catalog of AdvocateHub MCP tools with names and descriptions. Use this to discover, search, find, or list every available tool when tool_search only shows a subset. Filter by keyword (e.g. "member", "search", "reward", "challenge") or credential scope. No tenant credentials required.

ParametersJSON Schema
NameRequiredDescriptionDefault
queryNoOptional filter — case-insensitive substring match against tool name, title, or description.
credentialNoFilter by credential scope: org_token (integration API), sso (signed-in user), or any.any

TDQS

A4.7/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true and destructiveHint=false, and the description adds useful context: 'No tenant credentials required' and filtering capabilities. It doesn't contradict annotations and provides extra behavioral insight beyond the safety flags.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, front-loaded with the main purpose, and packed with actionable details. The examples are relevant without unnecessary verbosity; every sentence contributes value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple list tool with no output schema, the description covers return content, filtering options, and credential requirements. It's self-contained and complete; no missing aspects that an agent would need to know.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema already describes both parameters fully (100% coverage). The description adds value with example keywords ('member', 'search', 'reward', 'challenge') and explains the credential scope enum more concretely, going beyond the schema definitions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Returns the complete catalog of AdvocateHub MCP tools with names and descriptions' with a specific verb and resource. It distinguishes itself from tool_search by noting it shows every tool when tool_search only shows a subset.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly says 'Use this to discover, search, find, or list every available tool when tool_search only shows a subset', giving a clear use case. It also provides filtering guidance with examples and the no-credentials requirement, which helps the agent decide when to invoke it.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 5 tool updatesv0.1.0
    • First observedaudit_search
    • First observedaudit_tail
    • First observedconfigure_tenant
    • First observedget_active_identity_context
    • First observedlist_advocatehub_tools

TDQS

A3.9/5.0
Disambiguation4/5

The tools are mostly distinct: list_advocatehub_tools for discovery, configure_tenant for setup, get_active_identity_context for session context. The only potential confusion is between audit_tail and audit_search, but they are differentiated by recency vs. filtered search, and the descriptions clarify the distinction.

Naming Consistency4/5

All tool names use snake_case and are readable. Most follow a verb_first pattern (list_, configure_, get_), but audit_tail and audit_search place the resource (audit) before the verb, a minor deviation from the otherwise consistent convention.

Tool Count4/5

With five tools, the count falls within the typical 3-15 range and feels reasonable for a utility/admin-focused server. It is slightly on the smaller side given the apparent domain, but not inappropriately sparse.

Completeness1/5

The server name and list_advocatehub_tools description reference domain objects like members, rewards, and challenges, yet none of the actual tools perform any domain operations. The set is limited to configuration, identity, and audit utilities, leaving the core AdvocateHub functionality completely absent. Even within the meta-purpose, there is no way to modify configuration or manage audit logs beyond reading them.

Maintenance

ActivityMaintained
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    A
    maintenance
    The first full-featured MCP server for Adobe Experience Platform: 29 tools across schemas, datasets, profiles, segments, query service, and GDPR/CCPA privacy operations. Extends Adobe's read-only beta with production-grade write operations.
    174
    Apache 2.0
  • A
    license
    Not graded
    quality
    C
    maintenance
    MCP server for the HubSpot CRM API with tools for managing contacts, companies, deals, tickets, and CRM workflows. Generated with MCPForge. Sensitive operations can be protected with permissions, audit logs, and approval workflows.
    20
    MIT
  • F
    license
    Not graded
    quality
    C
    maintenance
    Custom MCP server for HubSpot CRM providing ICP segmentation, scoring, duplicate detection, Data Quality Score, and lifecycle stage automation. Exposes 39 tools to enhance HubSpot's native capabilities.
    -
  • A
    license
    Not graded
    quality
    B
    maintenance
    MCP gateway adding per-tool RBAC, tenant isolation, audit export, and PII redaction to any server.
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/akashtrilogy/advocatehub-influitive-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server