company-specific-docs-mcp-server
v1.0.14
Published
Company-specific documentation management system with MCP integration
Maintainers
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
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
- Clone the repository:
git clone <repository-url>
cd company-specific-docs-mcp-server- Install dependencies:
npm install- Build the project:
npm run buildConfiguration
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 devProduction Mode
npm startAPI Endpoints
The server implements the following MCP endpoints:
Resources
resources.list- List available resourcesresources.read- Read a specific resourceresources.templates- List resource templates
Tools
tools.list- List available toolstools.call- Call a specific tool
Available Tools:
list_company_manuals- List all company manuals with optional document type filtersmart_company_manual_search- Search company manuals using Typesense with query and optional document type filterfetch_company_documents_by_vector_search- Search documents using vector similarity with query and optional result limitget_by_company_document_name_or_num- Get a specific company document by its name or document number with optional exact matchget_company_manual_structure- Get the structure/outline of a company manual by document IDget_company_manual_chapter_overview- Get an overview of a specific chapter in a company manualread_company_manual_section- Read a specific section of a company manualread_company_manual_by_page_range- Read a specific range of pages from a company manualcreate_update_casefile- Create or update a case file with the provided informationgoogle_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 promptsprompts.get- Get a specific prompt
Testing
To test the server functionality, you can use the MCP inspector or interact with the server directly through stdio. Here are some example requests in JSON format that you can send to the server:
- List Resources:
{
"method": "resources.list"
}- List Tools:
{
"method": "tools.list"
}- Search Documents:
{
"method": "tools.call",
"params": {
"name": "smart_company_manual_search",
"arguments": {
"query": "your search query"
}
}
}To test the server:
- Start the server:
npm start- Send the JSON requests to the server's stdin. The server will respond through stdout.
Note: The server uses the Model Context Protocol (MCP) with stdio transport, which means it communicates through standard input/output rather than HTTP endpoints. This is the standard way MCP servers operate, allowing for direct integration with AI models and other MCP-compatible systems.
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 setupAdding New Tools
- Define the tool in
src/tools/index.ts - Implement the handler function
- Add the tool to the
toolDefinitionsarray
Adding New Resources
- Define the resource in
src/resources/index.ts - Implement the handler function
- Add the resource to the
resourceListarray
License
This project is licensed under the MIT License.
