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
Markdown
# ๐บ Bars MCP Server
[](https://badge.fury.io/js/bars-mcp-server)
[](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.