UNPKG

bars-mcp-server

Version:

MCP server for Bars - Library Documentation Service with up-to-date documentation and code examples

242 lines (183 loc) โ€ข 4.45 kB
# ๐Ÿบ Bars MCP Server [![npm version](https://badge.fury.io/js/bars-mcp-server.svg)](https://badge.fury.io/js/bars-mcp-server) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) Bars is a comprehensive library documentation service that provides up-to-date documentation and code examples for any library. It works as a Model Context Protocol (MCP) server for AI assistants like Cursor, Claude, VS Code, and more. ## โœจ Features - ๐Ÿ” **Smart Search**: Find libraries quickly with intelligent search - ๐Ÿ“š **Rich Documentation**: Get comprehensive documentation with code examples - โšก **Fast & Reliable**: Powered by Firebase with sub-second response times - ๐Ÿ”ง **MCP Compatible**: Works with all major AI assistants - ๐ŸŒ **Live API**: Access to live documentation service ## ๐Ÿš€ Quick Start ### Install in Cursor Go to: `Settings` -> `Cursor Settings` -> `MCP` -> `Add new global MCP server` ```json { "mcpServers": { "bars": { "command": "npx", "args": ["-y", "bars-mcp-server"] } } } ``` ### Install in Claude Desktop Add to your `claude_desktop_config.json`: ```json { "mcpServers": { "bars": { "command": "npx", "args": ["-y", "bars-mcp-server"] } } } ``` ### Install in VS Code Add to your VS Code MCP config: ```json { "servers": { "Bars": { "type": "stdio", "command": "npx", "args": ["-y", "bars-mcp-server"] } } } ``` ### Install in Zed Add to your Zed `settings.json`: ```json { "context_servers": { "Bars": { "command": { "path": "npx", "args": ["-y", "bars-mcp-server"] }, "settings": {} } } } ``` ### Install in Windsurf Add to your Windsurf MCP config: ```json { "mcpServers": { "bars": { "command": "npx", "args": ["-y", "bars-mcp-server"] } } } ``` ## ๐Ÿ› ๏ธ Usage Once installed, you can use Bars in your AI assistant: ``` Search for React documentation using Bars ``` ``` Get Next.js routing examples with Bars ``` ``` Find TypeScript best practices using Bars ``` ## ๐Ÿ”ง Available Tools - **resolve-library-id**: Search for libraries and get Bars-compatible IDs - **get-library-docs**: Fetch comprehensive documentation for any library ## ๐ŸŒ Live Service - **Website**: https://bars-fca85.web.app - **API**: https://api-h76uo622iq-uc.a.run.app ## โš™๏ธ Configuration ### Environment Variables ```json { "mcpServers": { "bars": { "command": "npx", "args": ["-y", "bars-mcp-server"], "env": { "DEFAULT_MINIMUM_TOKENS": "10000" } } } } ``` ### Alternative Runtimes #### Using Bun ```json { "mcpServers": { "bars": { "command": "bunx", "args": ["-y", "bars-mcp-server"] } } } ``` #### Using Deno ```json { "mcpServers": { "bars": { "command": "deno", "args": ["run", "--allow-env", "--allow-net", "npm:bars-mcp-server"] } } } ``` ## ๐Ÿณ Docker Support ```dockerfile FROM node:20-alpine RUN npm install -g bars-mcp-server CMD ["bars-mcp"] ``` ## ๐Ÿงช Testing Test the installation: ```bash echo '{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "resolve-library-id", "arguments": {"libraryName": "react"}}}' | npx -y bars-mcp-server ``` ## ๐Ÿ”ง Development ### Local Development ```bash git clone https://github.com/doctorai/bars-mcp-server.git cd bars-mcp-server npm install npm run build npm test ``` ### Building ```bash npm run build ``` ## ๐Ÿ“ API Reference ### Search Libraries ``` GET https://api-h76uo622iq-uc.a.run.app/v1/search?query={library_name} ``` ### Get Documentation ``` GET https://api-h76uo622iq-uc.a.run.app/v1/{library_path}?tokens={count}&topic={topic} ``` ## ๐Ÿค Contributing 1. Fork the repository 2. Create a feature branch 3. Make your changes 4. Test thoroughly 5. Submit a pull request ## ๐Ÿ“„ License MIT License - see [LICENSE](LICENSE) file for details. ## ๐Ÿ†š Comparison with Context7 Bars provides the same functionality as Context7 but with: - โœ… Your own infrastructure - โœ… Firebase-powered reliability - โœ… Custom branding - โœ… Full control over data and features ## ๐Ÿ“ž Support - ๐ŸŒ Website: https://bars-fca85.web.app - ๐Ÿ› Issues: https://github.com/doctorai/bars-mcp-server/issues - ๐Ÿ“ง Email: team@bars.dev --- Built with โค๏ธ using Firebase, TypeScript, and the Model Context Protocol.