StackBlitz文件读取MCP服务

用于从StackBlitz项目读取文件内容的MCP服务器,支持项目解析、文件列表、文件内容读取和搜索,帮助AI高效访问StackBlitz项目结构和代码。

  • by sxzz
  • Astro
  • 本地部署
  • 10 星标
  • 更新于
在 GitHub 查看 sxzz/stackblitz-mcp

使用说明

stackblitz-mcp

MCP server for reading files from StackBlitz projects. Enables AI to access file contents and project structure from StackBlitz reproduction repositories.

Install

npm i -g stackblitz-mcp

Usage

Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "stackblitz": {
      "command": "npx",
      "args": ["-y", "stackblitz-mcp"]
    }
  }
}

Claude Code

claude mcp add stackblitz -- npx -y stackblitz-mcp

Cursor

Add to your .cursor/mcp.json:

{
  "mcpServers": {
    "stackblitz": {
      "command": "npx",
      "args": ["-y", "stackblitz-mcp"]
    }
  }
}

Tools

resolve_project

Resolve a StackBlitz project URL or ID and return project metadata (title, description, preset, visibility, file count).

Input:

  • projectRef (string) — Project ID or StackBlitz URL (e.g. stackblitz-starters-rf7brvcm or https://stackblitz.com/edit/stackblitz-starters-rf7brvcm)

list_files

List files in a StackBlitz project as an ASCII tree, optionally filtered by path prefix.

Input:

  • projectRef (string) — Project ID or URL
  • path (string, optional) — Filter files by path prefix

read_file

Read the contents of a file from a StackBlitz project.

Input:

  • projectRef (string) — Project ID or URL
  • path (string) — File path within the project

search_files

Search for content within files of a StackBlitz project.

Input:

  • projectRef (string) — Project ID or URL
  • query (string) — Search query
  • regex (boolean, default: false) — Treat query as regex
  • caseSensitive (boolean, default: false) — Case-sensitive search
  • maxResults (number, default: 50) — Maximum number of results

Resources

URI Pattern Description
stackblitz://{projectId}/tree File tree of a project
stackblitz://{projectId}/files/{path} Contents of a specific file

Sponsors

License

MIT License © 2026-PRESENT Kevin Deng