Skip to content

danve/reactnative-mcp-server

Repository files navigation

NativePHP Documentation MCP Server

A Model Context Protocol (MCP) server that provides searchable access to NativePHP documentation. This server scrapes and indexes the complete NativePHP documentation, making it available through MCP tools for AI assistants like Claude.

What is this MCP Server?

This MCP server acts as a bridge between AI assistants and the NativePHP documentation. It:

  • Scrapes the entire NativePHP documentation from https://nativephp.com/docs
  • Indexes content using SQLite with full-text search (FTS5) capabilities
  • Provides four main tools for documentation access:
    • search_nativephp_docs() - Search across all documentation
    • get_nativephp_section() - Retrieve complete sections
    • refresh_nativephp_docs() - Update the local documentation cache
    • get_documentation_stats() - View database statistics

The server operates locally, requiring no API keys or external dependencies beyond the initial documentation scraping.

Installation

Prerequisites

  • Python 3.8 or higher
  • Git

Setup Steps

  1. Clone the repository

    git clone <repository-url>
    cd nativephp-mcp-server
  2. Create and activate virtual environment

    python3 -m venv .venv
    
    # On macOS/Linux:
    source .venv/bin/activate
    
    # On Windows:
    .venv\Scripts\activate
  3. Install dependencies

    pip install -r requirements.txt
  4. Test the server (optional)

    python nativephp_mcp_server.py

Claude Desktop Integration

  1. Locate your Claude Desktop config file:

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%/Claude/claude_desktop_config.json
  2. Add the MCP server configuration:

    {
      "mcpServers": {
        "nativephp-mcp-server": {
          "command": "/absolute/path/to/your/nativephp-mcp-server/.venv/bin/python",
          "args": ["/absolute/path/to/your/nativephp-mcp-server/nativephp_mcp_server.py"]
        }
      }
    }

    Replace /absolute/path/to/your/nativephp-mcp-server/ with your actual project path.

  3. Restart Claude Desktop to load the new MCP server.

More on MCP Protocol

The Model Context Protocol (MCP) is an open standard that enables AI assistants to securely connect to external data sources and tools. Key concepts:

MCP Architecture

  • MCP Client: The AI assistant (Claude Desktop)
  • MCP Server: This documentation server
  • Transport: Communication channel (stdio in this case)

Benefits of MCP

  • Security: Servers run in controlled environments with explicit permissions
  • Standardization: Uniform interface across different tools and data sources
  • Local Processing: No need to send sensitive data to external APIs
  • Extensibility: Easy to add new tools and capabilities

MCP vs Traditional APIs

  • No Authentication: MCP servers run locally without API keys
  • Rich Context: Servers can provide structured data and metadata
  • Tool Discovery: Clients automatically discover available server capabilities
  • Bidirectional: Servers can prompt clients for additional information

Learn more about MCP:

NativePHP Documentation Source

This MCP server sources its documentation from the official NativePHP website:

Primary Documentation URL: https://nativephp.com/docs

What is NativePHP?

NativePHP is a framework that allows you to build native desktop applications using PHP. It provides:

  • Desktop App Creation: Build native Windows, macOS, and Linux applications
  • Web Integration: Leverage existing PHP web development skills
  • Native Features: Access to system notifications, file dialogs, and OS integration
  • Laravel Integration: Seamless integration with Laravel framework

Documentation Coverage

This MCP server indexes the complete NativePHP documentation including:

  • Installation and setup guides
  • Configuration options
  • API reference
  • Examples and tutorials
  • Best practices

Official NativePHP Resources:

Architecture

Core Components

  • DocumentationScraper: Handles web scraping with rate limiting
  • SQLite Database: Stores content with FTS5 search capabilities
  • MCP Tools: Four exposed functions for documentation access
  • Content Processing: BeautifulSoup-based HTML parsing and cleaning

Database Schema

  • docs table: Stores scraped documentation (url, title, content, section, subsection)
  • docs_fts virtual table: Provides full-text search using SQLite FTS5

Rate Limiting

The server implements respectful scraping with 1-second delays between requests to avoid overwhelming the NativePHP servers.

Dependencies

  • mcp>=1.2.0 - Model Context Protocol framework
  • httpx>=0.27.0 - Async HTTP client for web scraping
  • beautifulsoup4>=4.12.0 - HTML parsing and content extraction
  • lxml>=4.9.0 - XML/HTML parser backend for BeautifulSoup

License

MIT License - See LICENSE file for details.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published