Skip to main content
Glama
mercurialsolo

Counsel MCP Server

Counsel MCP Server

npm version License: MIT Node.js Version

An open-source Model Context Protocol (MCP) server that connects AI agents to the Counsel API for strategic reasoning and multi-perspective analysis.

Features

  • Hosted & Self-Hosted - Use the hosted server instantly or run your own instance

  • Strategic Reasoning - Access Counsel's debate and multi-perspective reasoning engines

  • Advisor Sessions - Run interactive intake and profile tuning sessions

  • Native OAuth 2.0 - Standard MCP authentication handled automatically by clients

  • Dual Transport - STDIO for local clients, HTTP for web clients and shared servers


Related MCP server: Councly MCP Server

Table of Contents


Quick Start (Hosted)

Connect instantly to the hosted Counsel MCP server - no installation required:

http://counsel-mcp.getmason.dev/mcp

For MCP clients that support HTTP transport, simply add:

{
  "mcpServers": {
    "counsel": {
      "url": "http://counsel-mcp.getmason.dev/mcp",
      "transport": "http"
    }
  }
}

OAuth authentication is handled automatically by your MCP client.


Installation (Self-Hosted)

Run your own instance of the Counsel MCP server locally.

Prerequisites

  1. Node.js 18+ installed on your system

  2. A Counsel account at counsel.getmason.dev

Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "counsel": {
      "command": "npx",
      "args": ["-y", "counsel-mcp-server", "start"]
    }
  }
}
{
  "mcpServers": {
    "counsel": {
      "command": "npx",
      "args": ["-y", "counsel-mcp-server", "start"]
    }
  }
}

Claude Code (CLI)

claude mcp add counsel -- npx -y counsel-mcp-server start

Or manually add to your MCP settings:

{
  "mcpServers": {
    "counsel": {
      "command": "npx",
      "args": ["-y", "counsel-mcp-server", "start"]
    }
  }
}

Cursor

Add to your Cursor MCP configuration (.cursor/mcp.json in your project or global settings):

{
  "mcpServers": {
    "counsel": {
      "command": "npx",
      "args": ["-y", "counsel-mcp-server", "start"]
    }
  }
}

Windsurf

Add to your Windsurf MCP configuration:

{
  "mcpServers": {
    "counsel": {
      "command": "npx",
      "args": ["-y", "counsel-mcp-server", "start"]
    }
  }
}

VS Code with Copilot

Add to your VS Code settings (settings.json):

{
  "mcp.servers": {
    "counsel": {
      "command": "npx",
      "args": ["-y", "counsel-mcp-server", "start"]
    }
  }
}

Other MCP Clients

The server supports two transport modes. Choose based on your client's capabilities:

STDIO Mode (Default)

Most MCP clients use STDIO transport. Configure with:

{
  "mcpServers": {
    "counsel": {
      "command": "npx",
      "args": ["-y", "counsel-mcp-server", "start"],
      "env": {
        "COUNSEL_API_KEY": "your_api_key_here"
      }
    }
  }
}

HTTP Mode with OAuth

For clients that support HTTP transport with OAuth 2.0, run the server separately:

# Start the HTTP server
npx -y counsel-mcp-server http --port 3000

This starts an HTTP server with:

  • MCP endpoint: http://localhost:3000/mcp

  • OAuth discovery: http://localhost:3000/.well-known/oauth-authorization-server

Then configure your client to connect:

{
  "mcpServers": {
    "counsel": {
      "url": "http://localhost:3000/mcp",
      "transport": "http"
    }
  }
}

HTTP mode uses OAuth 2.0 with automatic token management - no API key required.

Transport Comparison

Feature

STDIO Mode

HTTP Mode

Command

npx -y counsel-mcp-server start

npx -y counsel-mcp-server http

Auth

API key via env var

OAuth 2.0 (automatic)

Setup

Single config

Run server + configure client

Best for

Claude Desktop, Cursor, VS Code

Web clients, shared servers


Authentication

The server supports two authentication modes:

STDIO Mode (Default)

Set the COUNSEL_API_KEY environment variable with your API key from counsel.getmason.dev:

export COUNSEL_API_KEY=your_api_key_here

Or add it to your MCP client configuration:

{
  "mcpServers": {
    "counsel": {
      "command": "npx",
      "args": ["-y", "counsel-mcp-server", "start"],
      "env": {
        "COUNSEL_API_KEY": "your_api_key_here"
      }
    }
  }
}

HTTP Mode (OAuth 2.0)

When running in HTTP mode (npx -y counsel-mcp-server http), authentication is handled automatically through OAuth 2.0:

  1. When you first use a Counsel tool, your MCP client will prompt for authentication

  2. You'll be redirected to sign in with your Counsel account

  3. After authorization, tokens are managed automatically

No manual API key required in HTTP mode - your MCP client handles the entire OAuth flow.

OAuth Endpoints (HTTP Mode)

The server exposes standard OAuth 2.0 endpoints:

Endpoint

Description

/.well-known/oauth-authorization-server

OAuth metadata discovery

/authorize

Authorization endpoint

/token

Token exchange endpoint

/register

Dynamic client registration


Available Tools

start_consultation

Start a new strategic consultation (debate) to analyze a complex question with multiple perspectives.

Parameter

Type

Required

Description

question

string

Yes

The core question to analyze

context

string

No

Additional context about the situation

mode

enum

No

Depth of analysis: quick, standard (default), deep

stakeholders

string[]

No

Key stakeholders to consider

Example:

Start a consultation about "Should we migrate our monolith to microservices?"
with context about our 50-person engineering team and mode set to deep

get_consultation_status

Check the status of an ongoing consultation.

Parameter

Type

Required

Description

debate_id

string

Yes

The ID of the consultation

get_consultation_report

Retrieve the final synthesis report from a completed consultation.

Parameter

Type

Required

Description

debate_id

string

Yes

The ID of the consultation

list_consultations

List your past consultations.

Parameter

Type

Required

Description

limit

number

No

Number of results (default: 10)

sharpen_question

Refine and improve a strategic question before starting a consultation.

Parameter

Type

Required

Description

question

string

Yes

The question to refine

context

string

No

Additional context

Example:

Sharpen this question: "Is AI good for our company?"

consult_advisor

Start an interactive advisor session for brainstorming or scoping problems.

Parameter

Type

Required

Description

question

string

Yes

The initial topic or question


Usage Examples

Strategic Decision Making

Use Counsel to analyze: "Should we expand into the European market in 2025?"

Consider these stakeholders: CEO, CFO, Head of Sales, Legal
Use deep analysis mode

Question Refinement

Use the sharpen_question tool to improve this question:
"How do we fix our culture?"

Context: We're a 200-person startup experiencing rapid growth

Checking Consultation Progress

Check the status of consultation abc-123-def

Configuration

Environment Variables

Variable

Default

Description

COUNSEL_API_URL

https://counsel.getmason.dev

Counsel API base URL

PORT

3000

Server port (HTTP mode)

CLI Commands

# STDIO mode (default) - for most MCP clients
npx -y counsel-mcp-server start

# HTTP mode - for clients supporting OAuth
npx -y counsel-mcp-server http [options]

HTTP Options:
  -p, --port <port>  Port to listen on (default: 3000)
  --host <host>      Host to bind to (default: localhost)

Troubleshooting

"Tool not found" Error

Ensure the MCP server is properly configured in your client. Restart your client after adding the configuration.

Authentication Issues

  1. Check that you have a valid Counsel account

  2. Try removing and re-adding the MCP server configuration

  3. Clear your client's MCP cache if available

Connection Refused

If running in HTTP mode, ensure:

  • The server is running (npx counsel-mcp-server start)

  • The port isn't blocked by a firewall

  • No other process is using the same port

Server Not Starting

# Check Node.js version (requires 18+)
node --version

# Try running directly to see errors
npx counsel-mcp-server start

Debug Mode

For verbose logging, check your MCP client's logs or run the server directly in a terminal to see output.


Development

Prerequisites

  • Node.js 18+

  • npm 9+

Setup

git clone https://github.com/mercurialsolo/counsel-mcp.git
cd counsel-mcp-server
npm install
npm run build

Commands

npm run build            # Compile TypeScript
npm run dev              # Watch mode
npm run start            # Run server
npm test                 # Run tests
npm run lint             # Type check
npm run security:check   # Scan staged files for secrets
npm run security:check:all  # Scan all files for secrets

Security

This project includes automated secret detection:

  • Pre-commit hook: Automatically scans staged files before each commit

  • CI integration: Security checks run on all pull requests

  • Pattern detection: AWS keys, GitHub tokens, API keys, private keys, etc.

See CONTRIBUTING.md for details.

Project Structure

src/
├── index.ts        # HTTP server, OAuth proxy, MCP transport
├── client.ts       # API client with request-scoped auth
├── config.ts       # Environment configuration
└── tools/
    ├── debates.ts  # Consultation tools
    └── advisor.ts  # Advisor session tools

Contributing

We welcome contributions! See CONTRIBUTING.md for guidelines.

Quick Start

  1. Fork the repository

  2. Create a feature branch: git checkout -b feature/your-feature

  3. Make your changes and add tests

  4. Run npm test to ensure tests pass

  5. Submit a pull request


License

MIT License - see LICENSE for details.


Available Tools

6 tools
consult_advisorD
ParametersJSON Schema
NameRequiredDescriptionDefault
questionYesThe initial topic or question.

TDQS

D1/5.0
Behavior1/5

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

Tool has no description.

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

Conciseness1/5

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

Tool has no description.

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

Completeness1/5

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

Tool has no description.

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

Parameters1/5

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

Tool has no description.

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

Purpose1/5

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

Tool has no description.

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

Usage Guidelines1/5

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

Tool has no description.

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

get_consultation_reportD
ParametersJSON Schema
NameRequiredDescriptionDefault
debate_idYesThe ID of the consultation.

TDQS

D1/5.0
Behavior1/5

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

Tool has no description.

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

Conciseness1/5

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

Tool has no description.

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

Completeness1/5

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

Tool has no description.

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

Parameters1/5

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

Tool has no description.

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

Purpose1/5

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

Tool has no description.

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

Usage Guidelines1/5

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

Tool has no description.

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

get_consultation_statusD
ParametersJSON Schema
NameRequiredDescriptionDefault
debate_idYesThe ID of the consultation to check.

TDQS

D1/5.0
Behavior1/5

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

Tool has no description.

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

Conciseness1/5

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

Tool has no description.

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

Completeness1/5

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

Tool has no description.

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

Parameters1/5

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

Tool has no description.

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

Purpose1/5

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

Tool has no description.

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

Usage Guidelines1/5

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

Tool has no description.

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

list_consultationsD
ParametersJSON Schema
NameRequiredDescriptionDefault
limitNo

TDQS

D1/5.0
Behavior1/5

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

Tool has no description.

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

Conciseness1/5

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

Tool has no description.

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

Completeness1/5

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

Tool has no description.

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

Parameters1/5

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

Tool has no description.

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

Purpose1/5

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

Tool has no description.

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

Usage Guidelines1/5

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

Tool has no description.

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

sharpen_questionD
ParametersJSON Schema
NameRequiredDescriptionDefault
questionYes
contextNo

TDQS

D1/5.0
Behavior1/5

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

Tool has no description.

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

Conciseness1/5

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

Tool has no description.

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

Completeness1/5

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

Tool has no description.

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

Parameters1/5

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

Tool has no description.

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

Purpose1/5

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

Tool has no description.

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

Usage Guidelines1/5

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

Tool has no description.

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

start_consultationD
ParametersJSON Schema
NameRequiredDescriptionDefault
questionYesThe core question to verify or analyze.
contextNoAdditional context about the situation.
modeNoDepth of analysis.standard
stakeholdersNoKey stakeholders to consider.

TDQS

D1/5.0
Behavior1/5

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

Tool has no description.

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

Conciseness1/5

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

Tool has no description.

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

Completeness1/5

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

Tool has no description.

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

Parameters1/5

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

Tool has no description.

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

Purpose1/5

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

Tool has no description.

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

Usage Guidelines1/5

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

Tool has no description.

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.

  1. 6 tool updatesv1.0.0
    • First observedconsult_advisor
    • First observedget_consultation_report
    • First observedget_consultation_status
    • First observedlist_consultations
    • First observedsharpen_question
    • First observedstart_consultation

TDQS

D1.9/5.0

Scored across 6 tools

Disambiguation4/5

The tools have mostly distinct purposes centered around consultation management: starting consultations, checking status, getting reports, listing them, sharpening questions, and consulting an advisor. There is some potential overlap between 'consult_advisor' and 'start_consultation' as both might initiate interactions, but the naming suggests different phases or modes of consultation.

Naming Consistency5/5

All tools follow a consistent verb_noun naming pattern with snake_case throughout. The verbs are clear and appropriate (consult, get, list, sharpen, start), and the nouns consistently relate to consultations or related concepts like advisor, report, status, and question.

Tool Count4/5

With 6 tools, the count is reasonable for a consultation-focused server. It covers core operations without being overly sparse or bloated. A slight deduction because, without descriptions, it's unclear if all tools are essential, but the scope appears well-defined.

Completeness3/5

The tools suggest a consultation lifecycle with start, status, report, and list operations, plus question refinement and advisor consultation. However, without descriptions, gaps are uncertain—for example, there's no clear update or delete tool for consultations, which might be needed for full lifecycle management. The surface seems functional but potentially incomplete.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers