Used for HTTP requests to communicate with the Onyx API
The runtime environment for the MCP server
The programming language used to build the MCP server
Used for data validation in the server's interactions with the Onyx API
Context Bank MCP
Overview
Context Bank MCP is a project using the Model Context Protocol (MCP) to create an interface for querying the AtherOS knowledge base through an API. This project builds an MCP server capable of interacting with the Onyx API to create chat sessions and send queries to the knowledge base.
Related MCP server: Astro Docs MCP Server
Features
Create new chat sessions to query the knowledge base
Send messages to chat sessions to receive responses from the knowledge base
Format and display results from the Onyx API
Technologies Used
TypeScript
Node.js
Model Context Protocol (MCP) SDK
Zod for data validation
Axios for HTTP requests
Installation
Configuration
The project uses environment variables to connect to the Onyx API. Follow these steps to configure your environment:
Automatic Setup (Recommended)
Run the setup script to configure your environment interactively:
This script will:
Create a
.envfile if it doesn't existPrompt you for your AtherOS API key
Allow you to customize the API base URL
Set default values for other configuration options
Manual Setup
Copy the example environment file to create your own:
Edit the
.envfile with your specific configuration:
Environment Variables
Required Environment Variables:
ONYX_API_KEY: Your AtherOS API keyONYX_API_BASE: Base URL for the AtherOS API (e.g., "http://172.30.22.52:3000")
Optional Environment Variables:
PORT: Port number for the server (default: 3000)NODE_ENV: Environment mode (development, production, test)LOG_LEVEL: Logging level (info, debug, error, warn)
Usage
After compilation, you can use the command line tool:
API Tools
The project provides two main MCP tools:
1. create_chat_session
Creates a new chat session to query the knowledge base.
Parameters:
persona_id(default: 0): User IDdescription(default: ""): Chat session description
2. query_atheros
Sends a message to the chat session to query the AtherOS knowledge base.
Parameters:
chat_session_id: Chat session IDmessage: Message contentparent_message_id: Parent message ID (can be null)
Response Format
Responses from knowledge base queries include:
Message ID
Message content
Rephrased query (if available)
Information about top source documents (if available):
Document name
Relevance score
Link to the document
Architecture
The project is organized with a simple structure:
src/index.ts: Main entry point of the application, defines the MCP tools and connection logicUses the stdio protocol to communicate with the MCP server
Development
License
ISC