Skip to content

moikas-code/mcp_server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bun-based MCP Server

This is a minimal Model Context Protocol (MCP) server using Bun, TypeScript, and the @modelcontextprotocol/sdk package. It demonstrates:

  • StdioServerTransport for local testing
  • A basic example tool (add) that adds two numbers
  • Dynamic tool loading from a (mocked) PostgreSQL database
  • Strict TypeScript and ESLint configuration

Setup

  1. Install Bun.
  2. Install dependencies:
bun install

Usage

Start the server:

bun run src/index.ts

The server will listen for MCP requests via stdio.

Tool Loading

The function load_tools_from_db simulates loading tool definitions and handlers from a PostgreSQL database. Replace this with real database logic as needed.

Example Tool

The add tool takes two numbers (a and b) and returns their sum as result.

Linting

bun run lint

Type Checking

bun run tsc

File Structure

  • src/index.ts: Main server entry point
  • tsconfig.json: TypeScript configuration
  • .eslintrc.json: ESLint configuration
  • package.json: Project metadata and scripts

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors