Skip to content

Conversation

@shanerbaner82
Copy link
Contributor

Summary

  • Adds an MCP (Model Context Protocol) server at /mcp/* for AI assistants to search and query NativePHP documentation
  • Includes both SSE endpoints for MCP clients and REST API endpoints for simpler integrations

Endpoints

Endpoint Method Purpose
/mcp/sse GET SSE stream for MCP clients
/mcp/message POST JSON-RPC tool calls
/mcp/health GET Health check
/mcp/api/search?q= GET REST search API
/mcp/api/page/{platform}/{version}/{section}/{slug} GET Get page content
/mcp/api/apis/{platform}/{version} GET List APIs
/mcp/api/navigation/{platform}/{version} GET Get nav structure

MCP Tools

  • search_docs - Full-text search with platform/version filters
  • get_page - Get full page content by path
  • list_apis - List all APIs for a platform/version
  • get_navigation - Get docs structure

Test plan

  • curl https://nativephp.com/mcp/health returns status ok
  • curl "https://nativephp.com/mcp/api/search?q=camera" returns results
  • MCP tool calls work via POST to /mcp/message

- Add DocsSearchService for searching and indexing documentation
- Add McpController with SSE and JSON-RPC endpoints
- Add REST API endpoints for search, page, apis, and navigation
- Add MCP routes at /mcp/*
- Add CSRF exception for MCP endpoints
@shanerbaner82 shanerbaner82 merged commit ee0f990 into main Jan 13, 2026
2 checks passed
@shanerbaner82 shanerbaner82 deleted the feature/mcp-docs-server branch January 13, 2026 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants