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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@luismdev/vibecontext-mcp

v0.0.6

Published

VibeContext Model Context Protocol (MCP) server for AI agents to interact with project documentation

Readme

@vibecontext/mcp-server

npm version License: MIT

A TypeScript Model Context Protocol (MCP) server for AI agents to interact with project documentation. Built with FastMCP framework.

🌟 Features

  • Document Management: Read and write documentation files securely
  • Tentative File Tracking: List and manage *.vc.md files in the .vibecontext/tentative directory
  • Git Integration: Get code diffs against HEAD for any file
  • Security: Sandboxed file access limited to the workspace directory
  • FastMCP Framework: Built on the robust FastMCP TypeScript framework
  • CLI Interface: Easy-to-use command line interface
  • Multiple Transports: Support for both stdio and HTTP transports

📦 Installation

Global Installation (Recommended)

npm install -g @vibecontext/mcp-server

Local Installation

npm install @vibecontext/mcp-server

🚀 Quick Start

Command Line Usage

# Start the server with default settings
vibecontext-mcp start

# Start with custom port and verbose logging
vibecontext-mcp start --port 3000 --verbose

# Use stdio transport (for MCP clients like Claude Desktop)
vibecontext-mcp start --stdio

# Start with custom workspace
vibecontext-mcp start --workspace /path/to/your/project

# Inspect server with FastMCP inspector
vibecontext-mcp inspect

Programmatic Usage

import { startMCPServer } from '@vibecontext/mcp-server';

// Start server programmatically
const server = await startMCPServer({
  port: 3333,
  transportType: 'httpStream',
  workspaceRoot: '/path/to/your/project',
  verbose: true,
});

🔧 Configuration

Environment Variables

# Optional: OpenAI API Key for AI functionalities
OPENAI_API_KEY=your_openai_api_key_here

# Optional: Custom server configuration
MCP_SERVER_PORT=3333
MCP_SERVER_HOST=localhost

MCP Client Configuration

Claude Desktop

Add to your Claude Desktop configuration (~/.config/claude/claude_desktop_config.json):

{
  "mcpServers": {
    "vibecontext": {
      "command": "vibecontext-mcp",
      "args": ["start", "--stdio", "--verbose"],
      "env": {
        "OPENAI_API_KEY": "your_key_here"
      }
    }
  }
}

Cursor IDE

Add to your .cursor/mcp.json:

{
  "mcpServers": {
    "vibecontext-mcp": {
      "command": "vibecontext-mcp",
      "args": ["start", "--stdio"],
      "env": {
        "NODE_ENV": "development"
      }
    }
  }
}

HTTP/URL Configuration

For HTTP transport, start the server and configure your client:

{
  "mcpServers": {
    "vibecontext-mcp": {
      "url": "http://localhost:3333/mcp"
    }
  }
}

🛠️ Available Tools

readDoc

Read the content of a document file.

Parameters:

  • path (string): Relative path to the file within the workspace

writeDoc

Create or overwrite a document file with provided content.

Parameters:

  • path (string): Relative path to the file within the workspace
  • content (string): Content to write to the file

listTentatives

List all tentative *.vc.md files in the .vibecontext/tentative/ directory.

Parameters: None

readCodeDiff

Get the diff of a file against HEAD using git.

Parameters:

  • filePath (string): Relative path to the file within the workspace

🔒 Security Features

  • Workspace Sandboxing: All file operations are restricted to the specified workspace directory
  • Path Validation: Prevents path traversal attacks through robust path validation
  • File Extension Filtering: Only allows access to specific file types (.md, .vc.md, .txt, .json, .ts, .js)
  • Error Handling: Comprehensive error handling with descriptive messages

📚 API Reference

MCPServerConfig

interface MCPServerConfig {
  port?: number; // Server port (default: 3333)
  host?: string; // Server host (default: 'localhost')
  transportType?: 'stdio' | 'httpStream'; // Transport type (default: 'httpStream')
  workspaceRoot?: string; // Workspace root path (default: process.cwd())
  verbose?: boolean; // Enable verbose logging (default: false)
}

startMCPServer(config?: MCPServerConfig)

Starts the MCP server with the given configuration.

Returns: Promise - The running FastMCP server instance

🧪 Development

Local Development

# Clone the repository
git clone https://github.com/your-username/vibe-context.git
cd vibe-context/apps/mcp

# Install dependencies
npm install

# Start in development mode
npm run dev

# Build the package
npm run build

# Test the CLI
npm run cli start --verbose

Testing

# Run tests
npm test

# Test with FastMCP inspector
npm run cli inspect

📖 Examples

Basic Usage with Different Clients

# For Claude Desktop (stdio)
vibecontext-mcp start --stdio --workspace ~/my-project

# For web-based MCP clients (HTTP)
vibecontext-mcp start --port 3333 --verbose

# For development with inspector
vibecontext-mcp inspect --workspace ~/my-project

Programmatic Integration

import { startMCPServer, MCPServerConfig } from '@vibecontext/mcp-server';

async function setupMCPServer() {
  const config: MCPServerConfig = {
    port: 3333,
    transportType: 'httpStream',
    workspaceRoot: '/path/to/project',
    verbose: true,
  };

  const server = await startMCPServer(config);
  console.log('MCP Server is running!');

  return server;
}

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Commit your changes: git commit -m 'feat: add amazing feature'
  4. Push to the branch: git push origin feature/amazing-feature
  5. Open a Pull Request

📝 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙋‍♂️ Support

🔗 Related Projects