library-mcp

MCP server for operating on Markdown knowledge bases

GitHub Stars

76

User Rating

Not Rated

Favorites

0

Views

29

Forks

4

Issues

2

Installation
Difficulty
Intermediate
Estimated Time
10-20 minutes
Requirements
Python 3.6以上
uvicorn 最新版
+1 more

Installation

Installation

Prerequisites

Please specify required software and versions:
Python: 3.6 or higher
uvicorn: Latest version
Claude Desktop: Latest version

Installation Steps

1. Clone Repository

bash
git clone https://github.com/lethain/library-mcp.git
cd library-mcp

2. Install Dependencies

bash
pip install uvicorn

3. Configure Claude Desktop

Edit claude_desktop_config.json to add the MCP server:
json
{
  "mcpServers": {
    "library-mcp": {
      "command": "uvicorn",
      "args": ["main:app", "--host", "127.0.0.1", "--port", "8000"]
    }
  }
}

4. Start Server

bash
uvicorn main:app --host 127.0.0.1 --port 8000

Troubleshooting

Common Issues

Issue: Server won't start Solution: Check Python version and reinstall dependencies. Issue: Not recognized by Claude Desktop Solution: Verify configuration file path and syntax.

Configuration

Configuration

Basic Configuration

Claude Desktop Setup

Edit ~/.config/claude-desktop/claude_desktop_config.json (macOS/Linux) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
json
{
  "mcpServers": {
    "library-mcp": {
      "command": "uvicorn",
      "args": ["main:app", "--host", "127.0.0.1", "--port", "8000"]
    }
  }
}

Environment Variables

Set the following environment variables as needed:
bash
export API_KEY="your-api-key"
export DEBUG="true"

Advanced Configuration

Security Settings

Store API keys in environment variables or secure configuration files
Set appropriate file access permissions
Adjust logging levels

Performance Tuning

Configure timeout values
Limit concurrent executions
Set up caching

Configuration Examples

Basic Configuration

json
{
  "mcpServers": {
    "library-mcp": {
      "command": "uvicorn",
      "args": ["main:app", "--host", "127.0.0.1", "--port", "8000"]
    }
  }
}

Examples

Examples

Basic Usage

Here are basic usage examples for the MCP server:

Using with Claude Desktop

1Verify MCP Server Startup
Open Claude Desktop and confirm that the configuration has been loaded correctly.
2Execute Basic Commands

   Available tools from this MCP server:
   - get_by_tag: Retrieves content by tag
   - get_by_text: Searches content for specific text
   

Programmatic Usage

python

Python example

import requests def call_mcp_tool(tool_name, params): response = requests.post( 'http://localhost:8000/mcp/call', json={ 'tool': tool_name, 'parameters': params } ) return response.json()

Usage example

result = call_mcp_tool('get_by_tag', { 'tag': 'python' }) print(result)

Use Cases

Retrieve the latest 50 posts related to a specific tag and summarize their content.
Fetch blog posts written in the last year by date range and analyze their content.
Search for Markdown files containing specific text and retrieve related information.
Simultaneously operate across multiple Markdown knowledge bases and integrate information.

Additional Resources

Author Information

427

Followers

79

Repositories

26

Gists

0

Total Contributions