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

company-specific-docs-mcp-server-sse

v1.0.0

Published

Company-specific documentation management system with MCP integration

Readme

Company Specific Docs MCP Server

A Model Context Protocol (MCP) server implementation for managing and searching company documents. This server provides tools for searching, retrieving, and managing company documentation using MongoDB for storage and Typesense for search capabilities.

Features

  • Document search using Typesense
  • Vector search capabilities
  • Company manual management
  • User details and document content retrieval
  • MCP protocol implementation for seamless integration
  • NPX support for easy installation and usage
  • SSE Server Mode - Expose MCP server via HTTP/SSE for web clients
  • Multi-transport Support - Support for stdio and SSE protocols
  • Docker Support - Production-ready Docker configuration

Prerequisites

  • Node.js (v16 or higher)
  • MongoDB connection
  • Typesense instance

Installation

Using NPX (Recommended)

You can run the server directly using NPX without installing it globally:

npx company-specific-docs-mcp-server@latest --mongo-uri "mongodb://<username>:<password>@<host>:<port>/<database>?authSource=<auth-db>" \
  --db-name "<database-name>" \
  --typesense-host "<typesense-host>" \
  --typesense-port "<typesense-port>" \
  --typesense-protocol "<typesense-protocol>" \
  --typesense-api-key "<typesense-api-key>"

Manual Installation

  1. Clone the repository:
git clone <repository-url>
cd company-specific-docs-mcp-server
  1. Install dependencies:
npm install
  1. Build the project:
npm run build

Configuration

The server requires the following environment variables or command-line arguments:

Environment Variables

Create a .env file in the project root with the following variables:

MONGO_URI=mongodb://<username>:<password>@<host>:<port>/<database>?authSource=<auth-db>
DB_NAME=<database-name>
TYPESENSE_HOST=<typesense-host>
TYPESENSE_PORT=<typesense-port>
TYPESENSE_PROTOCOL=<typesense-protocol>
TYPESENSE_API_KEY=<typesense-api-key>
COHERE_API_KEY=<cohere-api-key>
OPENAI_API_KEY=<openai-api-key>
S3_API_TOKEN=<s3-api-token>
PERPLEXITY_API_KEY=<perplexity-api-key>

Command-line Arguments

You can pass these values as command-line arguments:

npm start -- \
  --mongo-uri "mongodb://<username>:<password>@<host>:<port>/<database>?authSource=<auth-db>" \
  --db-name "<database-name>" \
  --typesense-host "<typesense-host>" \
  --typesense-port "<typesense-port>" \
  --typesense-protocol "<typesense-protocol>" \
  --typesense-api-key "<typesense-api-key>" \
  --cohere-api-key "<cohere-api-key>" \
  --openai-api-key "<openai-api-key>" \
  --s3-api-token "<s3-api-token>" \
  --perplexity-api-key "<perplexity-api-key>"

Running the Server

Development Mode

npm run dev

Production Mode

npm start

SSE Server Mode (New!)

The server now supports SSE (Server-Sent Events) mode, allowing you to expose your MCP server via HTTP/SSE for web clients, remote access, and integration with tools like Claude Desktop, Cursor, and Windsurf.

Quick Start SSE Server

npm run sse

This will:

  1. Build the project
  2. Start the SSE server on port 8000
  3. Expose endpoints at:
    • SSE Stream: http://localhost:8000/sse
    • Messages: http://localhost:8000/message

Manual SSE Server

./start-sse-server.sh

Docker SSE Server

npm run sse-docker

Configure MCP Clients

Once the SSE server is running, you can configure your MCP clients:

Claude Desktop (claude_desktop_config.json):

{
  "mcpServers": {
    "companyDocs": {
      "command": "npx",
      "args": ["-y", "supergateway", "--sse", "http://localhost:8000/sse"]
    }
  }
}

Cursor (~/.cursor/mcp.json):

{
  "mcpServers": {
    "companyDocs": {
      "command": "npx",
      "args": ["-y", "supergateway", "--sse", "http://localhost:8000/sse"]
    }
  }
}

Windsurf (~/.codeium/windsurf/mcp_config.json):

{
  "mcpServers": {
    "companyDocs": {
      "command": "npx",
      "args": ["-y", "supergateway", "--sse", "http://localhost:8000/sse"]
    }
  }
}

SSE Server Benefits

  • Web Access: Your MCP server is accessible via HTTP/SSE
  • Remote Access: Access from any machine on the network
  • Multiple Clients: Multiple clients can connect simultaneously
  • CORS Enabled: Works with web applications
  • Production Ready: Docker support with health checks

API Endpoints

The server implements the following MCP endpoints:

Resources

  • resources.list - List available resources
  • resources.read - Read a specific resource
  • resources.templates - List resource templates

Tools

  • tools.list - List available tools
  • tools.call - Call a specific tool

Available Tools:

  • list_company_manuals - List all company manuals with optional document type filter
  • smart_company_manual_search - Search company manuals using Typesense with query and optional document type filter
  • fetch_company_documents_by_vector_search - Search documents using vector similarity with query and optional result limit
  • get_by_company_document_name_or_num - Get a specific company document by its name or document number with optional exact match
  • get_company_manual_structure - Get the structure/outline of a company manual by document ID
  • get_company_manual_chapter_overview - Get an overview of a specific chapter in a company manual
  • read_company_manual_section - Read a specific section of a company manual
  • read_company_manual_by_page_range - Read a specific range of pages from a company manual
  • create_update_casefile - Create or update a case file with the provided information
  • google_search - Perform a Google search and return the results (requires API configuration)
  • get_mcp_build_version - Get the current MCP build version

Example tool usage:

{
  "method": "tools.call",
  "params": {
    "name": "get_company_manual_structure",
    "arguments": {
      "documentId": "document_id_here"
    }
  }
}

Prompts

  • prompts.list - List available prompts
  • prompts.get - Get a specific prompt

Testing

The server supports multiple testing modes:

Testing stdio Mode (Traditional)

To test the server functionality, you can use the MCP inspector or interact with the server directly through stdio:

npm test

Or manually:

  1. Start the server:
npm start
  1. Send JSON requests to the server's stdin. The server will respond through stdout.

Testing SSE Server Mode

To test the SSE server functionality:

  1. Start the SSE server:
npm run sse
  1. Test the SSE endpoint:
curl -X GET http://localhost:8000/sse
  1. Test with MCP Inspector:
npx @modelcontextprotocol/inspector

Then connect to http://localhost:8000/sse

Example MCP Requests

Here are some example requests in JSON format:

  1. List Resources:
{
  "method": "resources.list"
}
  1. List Tools:
{
  "method": "tools.list"
}
  1. Search Documents:
{
  "method": "tools.call",
  "params": {
    "name": "smart_company_manual_search",
    "arguments": {
      "query": "your search query"
    }
  }
}

Note: The server supports both stdio transport (traditional MCP) and SSE transport (for web clients). The SSE mode allows for HTTP/web access while maintaining full MCP compatibility.

Development

Project Structure

src/
├── index.ts              # Main server entry point
├── tools/               # Tool definitions and handlers
├── resources/           # Resource definitions and handlers
├── prompts/            # Prompt definitions and handlers
└── utils/              # Utility functions and configurations
    ├── config.ts       # Configuration management
    ├── mongodb.ts      # MongoDB client setup
    └── typesense.ts    # Typesense client setup

# SSE Server Files (New!)
├── start-sse-server.sh   # Script to start SSE server with environment variables
├── docker-compose.yml    # Docker configuration for SSE server
└── package.json         # Updated with SSE server scripts

Available Scripts

  • npm run dev - Development mode (stdio)
  • npm run build - Build the TypeScript project
  • npm run start - Production mode (stdio)
  • npm run test - Test with MCP Inspector
  • npm run sse - New! Start SSE server mode
  • npm run sse-docker - New! Start SSE server with Docker
  • npm run version-bump - Bump package version

Adding New Tools

  1. Define the tool in src/tools/index.ts
  2. Implement the handler function
  3. Add the tool to the toolDefinitions array

Adding New Resources

  1. Define the resource in src/resources/index.ts
  2. Implement the handler function
  3. Add the resource to the resourceList array

License

This project is licensed under the MIT License.