Claude Code serena MCP 问题

2026-04-11 12:111阅读0评论SEO资源
  • 内容介绍
  • 文章标签
  • 相关推荐
问题描述:

各位佬们,为什么我的Claude Code,我让他帮我理解一个 module 的时候,cc 直接去调用了内部的 Read file 工具。没有使用 Serena ,我在全局的 CLAUDE.md 中指定了| Understand module structure | serena get_symbols_overview | Quick symbol overview |,但是他死活不调用。codex 就没这个问题。

网友解答:
--【壹】--:

MCP是激活了的。我看 Serena 会给 CC 注入一大段 System Prompt,但是 CC 好像忽略了。而 Codex 会在第一次使用 serena时调用 serena.activate_project,serena.initial_instructions,serena.check_onboarding_performed 这些。cc 就不会


--【贰】--:

不会啊 你的出口是啥就是哪


--【叁】--:

CleanShot 2026-04-03 at 22.24.021124×860 101 KB
传了–project-from-cwd,还是要用–project来指定么


--【肆】--:

**定位/搜索代码、方法、类时,必须使用以下mcp:** - serena-SDS-claude mcp

我在claude.md里面是这样指定的,基本上每次都能主动去调用搜索代码
image3056×1588 277 KB


--【伍】--:

建议用之前先让CC检查所有mcp是否可用,自动都帮你配置好了


--【陆】--:

serena-SDS-claude mcp 是什么,看你这个调用的没问题,initial_instructions、onboarding都调用了。我的不会自动调用initial_instructions、onboarding


--【柒】--:

{
“text”: “\u003csystem-reminder\u003e\n# MCP Server Instructions\n\nThe following MCP servers have provided instructions for how to use their tools and resources:\n\n## context7\nUse this server to fetch current documentation whenever the user asks about a library, framework, SDK, API, CLI tool, or cloud service – even well-known ones like React, Next.js, Prisma, Express, Tailwind, Django, or Spring Boot. This includes API syntax, configuration, version migration, library-specific debugging, setup instructions, and CLI tool usage. Use even when you think you know the answer – your training data may not reflect recent changes. Prefer this over web search for library docs.\n\nDo not use for: refactoring, writing scripts from scratch, debugging business logic, code review, or general programming concepts.\n\n## deepwiki\nDeepWiki MCP provides AI-powered documentation for GitHub repositories.\n\nAvailable tools:\n- read_wiki_structure: Get a list of documentation topics for a repository\n- read_wiki_contents: View full documentation about a repository\n- ask_question: Ask any question about a repository and get an AI-powered answer\n- list_available_repos: List your available repositories (private mode only)\n- devin_knowledge_manage: Manage Devin knowledge notes and suggestions — list, search, get, create, update, delete notes, view folder structure, list/view/dismiss knowledge suggestions (private mode only)\n- devin_playbook_manage: Manage Devin playbooks — list, get, create, update, delete (private mode only)\n- devin_schedule_manage: Manage scheduled Devin sessions — list, get, create, update, delete (private mode only)\n- devin_session_create: Create one or more child Devin sessions (private mode only)\n- devin_session_interact: Manage a Devin session — get status, send messages, sleep/terminate/archive, read messages \u0026 attachments, manage tags (private mode only)\n- devin_session_events: Inspect session events — list summaries, fetch full details, or search event contents (private mode only)\n- devin_session_search: Search and filter Devin sessions (private mode only)\n- list_integrations: List all native integrations and MCP servers with their status and settings URLs (private mode only)\n\n## serena\nYou have access to semantic coding tools upon which you rely heavily for all your work.\nYou operate in a resource-efficient and intelligent manner, always keeping in mind to not read or generate\ncontent that is not needed for the task at hand.\n\nSome tasks may require you to understand the architecture of large parts of the codebase, while for others,\nit may be enough to read a small set of symbols or a single file.\nYou avoid reading entire files unless it is absolutely necessary, instead relying on intelligent step-by-step \nacquisition of information. Once you have read a full file, it does not make\nsense to analyse it with the symbolic read tools; you already have the information.\n\nYou can achieve intelligent reading of code by using the symbolic tools for getting an overview of symbols and\nthe relations between them, and then only reading the bodies of symbols that are necessary to complete the task at hand. \nYou can use the standard tools like list_dir, find_file and search_for_pattern if you need to.\nWhere appropriate, you pass the relative_path parameter to restrict the search to a specific file or directory.\n\nIf you are unsure about a symbol’s name or location (to the extent that substring_matching for the symbol name is not enough), you can use the search_for_pattern tool, which allows fast\nand flexible search for patterns in the codebase. In this way, you can first find candidates for symbols or files,\nand then proceed with the symbolic tools.\n\n\n\nSymbols are identified by their name_path and relative_path (see the description of the find_symbol tool).\nYou can get information about the symbols in a file by using the get_symbols_overview tool or use the find_symbol to search. \nYou only read the bodies of symbols when you need to (e.g. if you want to fully understand or edit it).\nFor example, if you are working with Python code and already know that you need to read the body of the constructor of the class Foo, you can directly\nuse find_symbol with name path pattern Foo/__init__ and `includ… [truncated]\n\u003c/system-reminder\u003e”,
“type”: “text”
} 抓了一下请求,貌似是因为 MCP Server Instructions 的内容,被 claude code 截断了,有大佬知道如何配置不截断么


--【捌】--:

是可用的,并且你让他调用,他也会去调用


--【玖】--:

哈雷佬 请教一个问题 就是我现在在ssh上用cc 在本地开代理然后在ssh上用RemoteForward转发 如果用家宽落地的话 会被cc检测到中转节点然后封号吗?


--【拾】--:

就是在本地启动的serena mcp,我做成了随windows启动的http服务器
image1800×1200 101 KB


--【拾壹】--:

项目打开要激活一下


--【拾贰】--:

[mcp_servers.serena]
startup_timeout_sec = 25
command = “uvx”
args = [“-p”, “3.13”, “–from”, “git+https://github.com/oraios/serena”, “serena”, “start-mcp-server”, “–project-from-cwd”, “–context”, “codex”] 这个是 codex 的配置,这两个看起来是一样的,但是 cc 不行


--【拾叁】--:

明白 那在ssh上还需要配两次RemoteForward吗 还是说走本地的那个代理端口然后本地配落地就行了?我的理解应该是后者,中转节点类似跳板机?


--【拾肆】--:

没有在claude.md中指定,都是claude code自主调用的


--【拾伍】--:

OK,我看 serena 的文档,initial_instructions 会在和 MCP 连接时通过 instructions 字段带给 claude code,这样 claude code 就不用调用 initial_instructions 了。不知道你这个为啥还是调用了 initial_instructions。你是在 CLAUDE.md 中指定了么,佬


--【拾陆】--:

image2332×1280 399 KB

标签:人工智能
问题描述:

各位佬们,为什么我的Claude Code,我让他帮我理解一个 module 的时候,cc 直接去调用了内部的 Read file 工具。没有使用 Serena ,我在全局的 CLAUDE.md 中指定了| Understand module structure | serena get_symbols_overview | Quick symbol overview |,但是他死活不调用。codex 就没这个问题。

网友解答:
--【壹】--:

MCP是激活了的。我看 Serena 会给 CC 注入一大段 System Prompt,但是 CC 好像忽略了。而 Codex 会在第一次使用 serena时调用 serena.activate_project,serena.initial_instructions,serena.check_onboarding_performed 这些。cc 就不会


--【贰】--:

不会啊 你的出口是啥就是哪


--【叁】--:

CleanShot 2026-04-03 at 22.24.021124×860 101 KB
传了–project-from-cwd,还是要用–project来指定么


--【肆】--:

**定位/搜索代码、方法、类时,必须使用以下mcp:** - serena-SDS-claude mcp

我在claude.md里面是这样指定的,基本上每次都能主动去调用搜索代码
image3056×1588 277 KB


--【伍】--:

建议用之前先让CC检查所有mcp是否可用,自动都帮你配置好了


--【陆】--:

serena-SDS-claude mcp 是什么,看你这个调用的没问题,initial_instructions、onboarding都调用了。我的不会自动调用initial_instructions、onboarding


--【柒】--:

{
“text”: “\u003csystem-reminder\u003e\n# MCP Server Instructions\n\nThe following MCP servers have provided instructions for how to use their tools and resources:\n\n## context7\nUse this server to fetch current documentation whenever the user asks about a library, framework, SDK, API, CLI tool, or cloud service – even well-known ones like React, Next.js, Prisma, Express, Tailwind, Django, or Spring Boot. This includes API syntax, configuration, version migration, library-specific debugging, setup instructions, and CLI tool usage. Use even when you think you know the answer – your training data may not reflect recent changes. Prefer this over web search for library docs.\n\nDo not use for: refactoring, writing scripts from scratch, debugging business logic, code review, or general programming concepts.\n\n## deepwiki\nDeepWiki MCP provides AI-powered documentation for GitHub repositories.\n\nAvailable tools:\n- read_wiki_structure: Get a list of documentation topics for a repository\n- read_wiki_contents: View full documentation about a repository\n- ask_question: Ask any question about a repository and get an AI-powered answer\n- list_available_repos: List your available repositories (private mode only)\n- devin_knowledge_manage: Manage Devin knowledge notes and suggestions — list, search, get, create, update, delete notes, view folder structure, list/view/dismiss knowledge suggestions (private mode only)\n- devin_playbook_manage: Manage Devin playbooks — list, get, create, update, delete (private mode only)\n- devin_schedule_manage: Manage scheduled Devin sessions — list, get, create, update, delete (private mode only)\n- devin_session_create: Create one or more child Devin sessions (private mode only)\n- devin_session_interact: Manage a Devin session — get status, send messages, sleep/terminate/archive, read messages \u0026 attachments, manage tags (private mode only)\n- devin_session_events: Inspect session events — list summaries, fetch full details, or search event contents (private mode only)\n- devin_session_search: Search and filter Devin sessions (private mode only)\n- list_integrations: List all native integrations and MCP servers with their status and settings URLs (private mode only)\n\n## serena\nYou have access to semantic coding tools upon which you rely heavily for all your work.\nYou operate in a resource-efficient and intelligent manner, always keeping in mind to not read or generate\ncontent that is not needed for the task at hand.\n\nSome tasks may require you to understand the architecture of large parts of the codebase, while for others,\nit may be enough to read a small set of symbols or a single file.\nYou avoid reading entire files unless it is absolutely necessary, instead relying on intelligent step-by-step \nacquisition of information. Once you have read a full file, it does not make\nsense to analyse it with the symbolic read tools; you already have the information.\n\nYou can achieve intelligent reading of code by using the symbolic tools for getting an overview of symbols and\nthe relations between them, and then only reading the bodies of symbols that are necessary to complete the task at hand. \nYou can use the standard tools like list_dir, find_file and search_for_pattern if you need to.\nWhere appropriate, you pass the relative_path parameter to restrict the search to a specific file or directory.\n\nIf you are unsure about a symbol’s name or location (to the extent that substring_matching for the symbol name is not enough), you can use the search_for_pattern tool, which allows fast\nand flexible search for patterns in the codebase. In this way, you can first find candidates for symbols or files,\nand then proceed with the symbolic tools.\n\n\n\nSymbols are identified by their name_path and relative_path (see the description of the find_symbol tool).\nYou can get information about the symbols in a file by using the get_symbols_overview tool or use the find_symbol to search. \nYou only read the bodies of symbols when you need to (e.g. if you want to fully understand or edit it).\nFor example, if you are working with Python code and already know that you need to read the body of the constructor of the class Foo, you can directly\nuse find_symbol with name path pattern Foo/__init__ and `includ… [truncated]\n\u003c/system-reminder\u003e”,
“type”: “text”
} 抓了一下请求,貌似是因为 MCP Server Instructions 的内容,被 claude code 截断了,有大佬知道如何配置不截断么


--【捌】--:

是可用的,并且你让他调用,他也会去调用


--【玖】--:

哈雷佬 请教一个问题 就是我现在在ssh上用cc 在本地开代理然后在ssh上用RemoteForward转发 如果用家宽落地的话 会被cc检测到中转节点然后封号吗?


--【拾】--:

就是在本地启动的serena mcp,我做成了随windows启动的http服务器
image1800×1200 101 KB


--【拾壹】--:

项目打开要激活一下


--【拾贰】--:

[mcp_servers.serena]
startup_timeout_sec = 25
command = “uvx”
args = [“-p”, “3.13”, “–from”, “git+https://github.com/oraios/serena”, “serena”, “start-mcp-server”, “–project-from-cwd”, “–context”, “codex”] 这个是 codex 的配置,这两个看起来是一样的,但是 cc 不行


--【拾叁】--:

明白 那在ssh上还需要配两次RemoteForward吗 还是说走本地的那个代理端口然后本地配落地就行了?我的理解应该是后者,中转节点类似跳板机?


--【拾肆】--:

没有在claude.md中指定,都是claude code自主调用的


--【拾伍】--:

OK,我看 serena 的文档,initial_instructions 会在和 MCP 连接时通过 instructions 字段带给 claude code,这样 claude code 就不用调用 initial_instructions 了。不知道你这个为啥还是调用了 initial_instructions。你是在 CLAUDE.md 中指定了么,佬


--【拾陆】--:

image2332×1280 399 KB

标签:人工智能