Token导航 LogoToken导航TokenDH.com
Faststack MCP logo
开发工具stdio官方级别未说明来源级核验

Faststack MCP

MCP Server

faststack-mcp是一个本地优先、只读的MCP服务器,用于索引和搜索全栈项目(如FastAPI + React + PostgreSQL),支持SQLite全文搜索、交叉引用图和文件监视自动重载,使Claude仅读取所需内容而非整个文件。

工具数

12

提示词数

0

GitHub Stars

3

资源数

0
代码索引PythonClaude开发工具Claude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

Evaan-devlops

提供方

Evaan-devlops

最后核验

2026/5/17 20:21

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

pip install -e .

详细介绍

faststack mcp

Claude Code的本地优先只读MCP服务器。索引和搜索全栈项目 (快速API+反应+PostgreSQL) SQLite支持的FTS, 交叉参考图,以及 文件监视器 自动重新加载——这样克劳德只读取它需要的内容,而不是整个文件。

______________________________________________________________________

快速开始

步骤1--安装

# From local source (development)
cd C:\path\to\faststack-mcp
pip install -e .

# From GitHub
pip install "git+https://github.com/Evaan-devlops/faststack-mcp.git"

# With optional extras
pip install -e ".[watch]"     # file watcher (watchfiles)
pip install -e ".[postgres]"  # PostgreSQL backend (psycopg2-binary)
pip install -e ".[all]"       # both
全球已经有了watchiles/psycopg2? 无需额外安装——它们 自动拾取。

步骤2——添加到Claude代码

{
  "mcpServers": {
    "faststack": {
      "command": ".venv\\Scripts\\python.exe",
      "args": ["-m", "faststack_mcp"]
    }
  }
}

第3步——为项目建立索引

index_folder("/path/to/your/project")          → project_id + counts
index_folder("/path/to/project", watch=True)   → + auto-reindex on file changes

第四步——探索

get_project_outline(project_id)                → structure at a glance (~17 tokens)
search_symbols(project_id, "createUser")       → find functions, routes, hooks, models
get_symbol(project_id, symbol_id)              → exact code snippet only
find_references(project_id, "get_db")          → all files that import / call a symbol
get_file_context(project_id, "db.py", 120)     → 80 lines around line 120
get_file_outline(project_id, "main.py")        → all symbols in one file
search_text(project_id, "HTTPException")       → fallback full-text search
get_file_tree(project_id)                      → directory tree
list_projects()                                → all indexed projects
invalidate_cache(project_id)                   → force full re-index
get_token_usage()                              → cost + per-session averages

______________________________________________________________________

工具参考(12个工具)

工具目的关键参数
index_folder扫描并缓存项目path, force, watch, include_env_files
list_projects浏览缓存项目--
search_symbols主导航 --排名FTS符号搜索query, kind, language, include_synthetic
get_symbol按symbol_id读取准确的代码片段symbol_id
find_references --导入符号的图形+文本扫描symbol_name, limit
get_file_context --读取行号周围的N行file_path, around_line, radius=40
search_text在所有文件中进行全文搜索query, limit
get_project_outline分组结构概述sections
get_file_tree索引文件的目录树--
get_file_outline一个文件中的所有符号file_path
invalidate_cache删除缓存索引project_id
get_token_usage会话成本+工具细分last_n, session_id

find_references --依赖性影响分析

find_references(project_id, "get_db")
→ {
    symbol_name: "get_db",
    files_found: 3,
    total_usages: 3,
    references: [
      { file_path: "users.py",  usages: [{ line: 5,  context: "from db import get_db" }] },
      { file_path: "auth.py",   usages: [{ line: 12, context: "db = get_db()" }] },
      { file_path: "orders.py", usages: [{ line: 8,  context: "from db import get_db" }] }
    ]
  }

在修改共享符号之前使用,以了解爆炸半径。使用构建的导入图 在...期间 index_folder (快速路径),将整词正则表达式扫描作为回退。

get_file_context --周围代码窗口

get_file_context(project_id, "src/db.py", around_line=120, radius=40)
→ lines 80–160, line 120 marked with >>>

使用时 get_symbol 太窄了——例如,理解符号边界周围的代码, 检查迁移函数或读取错误处理上下文。

______________________________________________________________________

存储后端

被控制 FASTSTACK_STORAGE 环境变量。

默认值何时使用
sqlite本地开发,任何项目规模。单身 ~/.faststack-mcp/faststack.db 使用FTS5。
postgres共享团队索引、大型项目或您希望在项目数据库中添加索引时。需要 DATABASE_URL.
json与v0.2之前的缓存向后兼容。无FTS或参考图。

SQLite(默认)

无需配置。特征:

  • FTS5虚拟表上的符号名称+合格名称+签名
  • FTS5+LIKE组合回退(手柄 get_db, create_user 下划线名称)
  • refs 桌子用于 find_references 查找
  • WAL模式——索引时并发读取

PostgreSQL

export FASTSTACK_STORAGE=postgres
export DATABASE_URL=postgresql://user:pass@localhost:5433/mydb

特征:

  • GENERATED ALWAYS AS tsvector列+GIN索引(零维护FTS)
  • ts_rank 相关性排序+ILIKE补充
  • 表前缀 faststack_* (与您的应用程序表没有冲突)
  • 通过批量插入 execute_values (500行/页)
  • faststack_references 桌子用于 find_references
psycopg2-binary 必须安装(pip install psycopg2-binarypip install faststack-mcp[postgres]).

______________________________________________________________________

文件监视器(自动重新索引)

# Start watcher alongside indexing
index_folder("/path/to/project", watch=True)
  • 用途 watchfiles (安装: pip install watchfilespip install faststack-mcp[watch])
  • 1.5秒去抖动——在重新索引火灾之前,快速保存是分批进行的
  • 后台守护进程线程--未阻止Claude
  • 如果 watchfiles 未安装

______________________________________________________________________

交叉参考图

期间自动构建 index_folder.跟踪每一个 importfrom X import Y 跨Python和TypeScript/JavaScript文件的语句。

图形存储在索引中,并通过以下方式查询 find_references。它能够:

  • 在一次工具调用中,“什么调用/导入此符号?”
  • 重构共享实用程序之前的影响分析
  • 理解FastAPI依赖注入(Depends(get_db))

______________________________________________________________________

搜索-- include_synthetic 行为

根据具体情况显示或隐藏合成符号(自动生成的模型字段、配置键) 根据上下文:

查询类型默认
pydantic_model, model, type, interface展示 (字段很有用)
config_key, config_file, tsconfig, json_key展示
其他一切隐藏

明确覆盖: search_symbols(project_id, "User", include_synthetic=True)

______________________________________________________________________

令牌使用分析

get_token_usage(last_n=20)
→ {
    totals: { input_tokens, output_tokens, estimated_cost_usd },
    averages: { input_tokens_per_session, cost_usd_per_session },
    tool_breakdown: { get_symbol: { calls: 18, est_saved: 136800 }, ... },
    estimated_tokens_saved_by_mcp: 209000
  }

需要插入止动钩 ~/.claude/settings.json 以记录会话数据。

______________________________________________________________________

支持的文件类型

来源: .py .ts .tsx .js .jsx .sql

配置/元: .json .jsonl .toml .yaml .yml .ini

命名文件: package.json pyproject.toml tsconfig.json tsconfig.app.json tsconfig.node.json vite.config.* alembic.ini eslint.config.js tailwind.config.js tailwind.config.ts manifest.json chunks.jsonl index.faiss bunfig.toml .env.example

跳过dirs: .git node_modules .next dist build coverage .venv venv __pycache__ .mypy_cache .pytest_cache .idea .vscode .claude

跳过敏感文件: .env .env.* *.pem *.key *.p12 id_rsa id_ed25519 (.env* 文件选择通过 include_env_files=True)

______________________________________________________________________

解析器

语言分析器摘录
Python/FastAPIast函数、类、路由、复制模型、服务、仓库、装饰器、Depends()
Types/Reacttree-sitter +正则表达式回退组件、钩子、类型、接口、后端路由/服务/存储库
SQLregex表、视图、索引、函数、过程、触发器
JSON/jsonljson.loads根密钥、RAG块字段、清单元数据
配置tomllib / json / yaml / ini包脚本/deps、tsconfig、vite、eslint、alembic
Envregex(掩码)变量名--存储为的值 ***MASKED***
顺风启发式配置键,类名使用

______________________________________________________________________

安全

  • 所有文件读取路径仅限于索引项目根目录
  • 每次查找时都会进行Symlink转义检查
  • 二进制文件检测(空字节扫描)
  • 文件大小上限(默认2 MB)
  • 默认情况下跳过敏感文件模式
  • 不对项目文件执行写入或shell操作
  • SQLite缓存隔离在 ~/.faststack-mcp/

______________________________________________________________________

安装选项

# Local dev
pip install -e "C:\path\to\faststack-mcp"

# GitHub
pip install "git+https://github.com/Evaan-devlops/faststack-mcp.git"

# With extras
pip install -e ".[watch]"       # watchfiles — file watcher
pip install -e ".[postgres]"    # psycopg2-binary — PostgreSQL backend
pip install -e ".[all]"         # both

环境变量

变量默认值描述
FASTSTACK_STORAGEsqlite存储后端: sqlite, postgres, json
DATABASE_URL--PostgreSQL DSN(需要时 FASTSTACK_STORAGE=postgres)

发展

python -m venv .venv
.venv\Scripts\python -m pip install -e .
python -m py_compile src/faststack_mcp/server.py  # syntax check
pytest tests/

Env解析

  • .env.example 默认情况下使用掩码值进行索引(***MASKED***)
  • .env.env.* 跳过,除非 include_env_files=True
  • 原始值从未持续存在

目录标签

目录标签

代码索引PythonClaude开发工具本地部署全文搜索交叉引用文件监视

支持客户端

Claude

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

session

工具数量(toolCount,工具数)

12

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdiosession部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP