Base Implementation Framework
Build AI-powered applications with a standardized framework for integrating LLMs. Create and manage MCP servers and clients effortlessly, leveraging built-in support for tools, resources, and prompts. Get started quickly with sample templates and modular design for easy customization.
Installation
Installing for Claude Desktop
Manual Configuration Required
This MCP server requires manual configuration. Run the command below to open your configuration file:
npx mcpbar@latest edit -c claude
This will open your configuration file where you can add the Base Implementation Framework MCP server manually.
MCP Base - A Generic Model Context Protocol Framework
This folder contains a general-purpose base implementation of the Model Context Protocol (MCP) for building AI-powered applications. It provides a standardized way to create MCP servers and clients that can be used to integrate LLMs into your applications.
π Features
- Standardized MCP Server: A base server implementation with support for HTTP and stdio transports
- Generic MCP Client: A client for connecting to any MCP server
- Ollama Integration: Ready-to-use services for generating embeddings and text with Ollama
- Supabase Integration: Built-in support for Supabase vector database
- Modular Design: Clearly organized structure for resources, tools, and prompts
- Sample Templates: Example implementations to help you get started quickly
π οΈ Directory Structure
_mcp-base/
βββ server.ts # Main MCP server implementation
βββ client.ts # Generic MCP client
βββ utils/ # Utility services
β βββ ollama_embedding.ts # Embedding generation with Ollama
β βββ ollama_text_generation.ts # Text generation with Ollama
βββ tools/ # Tool implementations
β βββ sample-tool.ts # Example tool template
βββ resources/ # Resource implementations
β βββ sample-resource.ts # Example resource template
βββ prompts/ # Prompt implementations
β βββ sample-prompt.ts # Example prompt template
βββ README.md # This documentation
π Getting Started
Prerequisites
- Node.js and npm/pnpm
- Ollama for local embedding and text generation
- Supabase account for vector storage
Environment Setup
Create a .env
file with the following variables:
PORT=3000
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_SERVICE_KEY=your-service-key
OLLAMA_URL=http://localhost:11434
OLLAMA_EMBED_MODEL=nomic-embed-text
OLLAMA_LLM_MODEL=llama3
SERVER_MODE=http # 'http' or 'stdio'
Server Initialization
- Import the required modules
- Register your resources, tools, and prompts
- Start the server
// Import base server and utilities
import server from "./server";
import { registerSampleResources } from "./resources/sample-resource";
import { registerSampleTool } from "./tools/sample-tool";
import { registerSamplePrompts } from "./prompts/sample-prompt";
// Initialize database if needed
async function initializeDatabase() {
// Your database initialization logic
}
// Register your components
registerSampleResources(server, supabase);
registerSampleTool(server, textGenerator, embeddings, supabase);
registerSamplePrompts(server, supabase);
// Start the server
startServer();
Client Usage
import MCPClient from "./client";
// Create a client instance
const client = new MCPClient({
serverUrl: "http://localhost:3000",
});
// Example: Call a tool
async function callSampleTool() {
const result = await client.callTool("sample-tool", {
query: "example query",
maxResults: 5,
});
console.log(result);
}
// Example: Read a resource
async function readResource() {
const items = await client.readResource("items://all");
console.log(items);
}
// Example: Get a prompt
async function getPrompt() {
const prompt = await client.getPrompt("simple-prompt", {
task: "Explain quantum computing",
});
console.log(prompt);
}
// Don't forget to disconnect when done
await client.disconnect();
π Extending the Framework
Creating a New Tool
- Create a new file in the
tools/
directory - Define your tool function and schema using Zod
- Implement your tool logic
- Register the tool in your server
Creating a New Resource
- Create a new file in the
resources/
directory - Define your resource endpoints and schemas
- Implement your resource logic
- Register the resource in your server
Creating a New Prompt
- Create a new file in the
prompts/
directory - Define your prompt schema and parameters
- Implement your prompt template
- Register the prompt in your server
π License
MIT
Details:
Stars
0Forks
0Last commit
4 months agoRepository age
4 months
Auto-fetched from GitHub .
MCP servers similar to Base Implementation Framework:

Β
Β
Β
Stars
Forks
Last commit

Β
Β
Β
Stars
Forks
Last commit

Β
Β
Β
Stars
Forks
Last commit