Skip to content

Add MCP server and plugin MCP discovery support#89

Merged
saurabhsharma2u merged 3 commits into
mainfrom
codex/add-mcp-server-to-typescript-cli-project
Mar 3, 2026
Merged

Add MCP server and plugin MCP discovery support#89
saurabhsharma2u merged 3 commits into
mainfrom
codex/add-mcp-server-to-typescript-cli-project

Conversation

@saurabhsharma2u

Copy link
Copy Markdown
Contributor

Motivation

  • Introduce a Model Context Protocol (MCP) bridge so Crawlith CLI workflows can be exposed as MCP tools and prompts.
  • Allow plugins to declaratively or imperatively register MCP tools/prompts during startup so third-party plugins can extend the MCP surface.
  • Provide a standalone @crawlith/mcp package to run an MCP server that invokes the Crawlith CLI and aggregates plugin-provided definitions.

Description

  • Extend core plugin types by adding PluginMcpTool, PluginMcpPrompt, PluginMcpDiscovery, and a mcpDiscovery field on PluginContext, and expose mcp and onMcpDiscovery on CrawlithPlugin for declarative and hook-based discovery.
  • Add a new package @crawlith/mcp with an MCP server implementation in src/mcp-server.ts that registers built-in tools (ensure_crawlith_cli, crawl_site, analyze_page, probe_domain, list_sites) and built-in prompts via src/prompts.ts.
  • Implement plugin discovery in the MCP server by loading repository plugins (via PluginLoader), merging declarative plugin.mcp entries and running hooks.onMcpDiscovery(ctx) with a ctx.mcpDiscovery API that calls registerTool/registerPrompt.
  • Provide CLI resolution and execution utilities including resolveCliCommand, runCliCommand, and ensureCliAvailable (with optional install via npm/pnpm/yarn/bun) and add package metadata and README for the new package.

Testing

  • No automated tests were run for this change.

Codex Task

@saurabhsharma2u
saurabhsharma2u merged commit e24f229 into main Mar 3, 2026
1 of 7 checks passed
@saurabhsharma2u
saurabhsharma2u deleted the codex/add-mcp-server-to-typescript-cli-project branch March 3, 2026 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant