Repository navigation
docs(plugin): add optional Sem example #2426
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| { | ||
| "name": "sem-code-review", | ||
| "version": "0.1.0", | ||
| "description": "Local code-entity search, caller inspection and structural diffs with Sem.", | ||
| "author": { "name": "Ataraxy Labs" }, | ||
| "license": "Apache-2.0", | ||
| "mcpServers": "./.mcp.json" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| { | ||
| "sem": { | ||
| "command": "npx", | ||
| "args": ["-y", "@ataraxy-labs/sem@0.27.0", "mcp"], | ||
| "env": { | ||
| "SEM_REPO": "${SEM_REPO}", | ||
| "SEM_NO_NETWORK": "1", | ||
| "SEM_NO_TELEMETRY": "1" | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| # Sem local code review for DeepChat | ||
|
|
||
| An optional MCP-only plugin for [Sem](https://github.com/Ataraxy-Labs/sem): inspect | ||
| code entities, callers, dependencies and structural diffs in a local Git repository. | ||
| No Sem account or API key is required. This example adds no hooks, Skills or bundled binaries. | ||
| It leaves existing model settings and MCP servers unchanged. | ||
|
|
||
| ## Install | ||
|
|
||
| Use a DeepChat version with user plugins (v1.1.2-beta.5 or later), Git, and Node.js/npm | ||
| available through DeepChat's Toolchains settings. This example targets macOS/Linux on ARM64/x64. | ||
| Enabling the server invokes npx; first installation downloads the pinned npm package and native | ||
| Sem binary. Only connect a repository whose build/test scripts you trust. | ||
|
|
||
| 1. Obtain a checkout containing this example. Until its PR merges, use the PR's exact commit. | ||
| 2. From this directory, package the hidden files as well as the README: | ||
|
|
||
| ```sh | ||
| python3 -m zipfile -c /tmp/sem-code-review.zip .codex-plugin .mcp.json README.md | ||
| ``` | ||
|
|
||
| Choose a suitable output path on your platform. Do not package the whole repository, | ||
| credentials, `.git` or `node_modules`. | ||
| 3. Open **Plugins → Install from ZIP** and inspect the archive. Expect one stdio server, | ||
| the pinned command above, and one required variable, `SEM_REPO`. Select MCP and install. | ||
| Installation leaves the plugin disabled. | ||
| 4. Explicitly enable the plugin and use its MCP setup form to supply `SEM_REPO`: an absolute | ||
| path to an existing local Git repository. The generic setup form masks variable values; | ||
| this value is a directory path, not an API key. It is not inherited from your shell. | ||
| 5. Check the plugin's MCP connection status and discovered tool schemas. Plugin-owned servers | ||
| are separate from the ordinary MCP settings list. Discovery is not proof that a tool call works. | ||
|
|
||
| ## Try it | ||
|
|
||
| Substitute a symbol that exists in the selected repository: | ||
|
|
||
| > Use Sem to locate `parse_config`, inspect its callers and explain the code. Do not edit files or run tests. | ||
|
|
||
| For a checkout with tracked local changes: | ||
|
|
||
| > Inspect the structural diff with Sem and explain the changes. Do not execute validation commands. | ||
|
|
||
| The graph's coverage depends on the language and source constructs. Missing results do not prove | ||
| there are no references. Retain ordinary file tools for configuration and unresolved code. | ||
| This plugin does not configure external ACP agents or provide Weave editing/merging tools. | ||
|
|
||
| ## Permissions and privacy | ||
|
|
||
| - `sem_check` can run repository build/test commands. Keep normal tool approvals and only | ||
| authorize execution intentionally; this is not a read-only server. | ||
| - `SEM_REPO` selects a repository; it is not an operating-system sandbox. | ||
| - The preset disables Sem cloud access and telemetry recording. npm/native-binary installation | ||
| still uses the network. Those flags do not sandbox commands run by repository checks. | ||
| - Returned source code enters the conversation and may reach the configured model provider. | ||
| - Sem builds a local index. Structural results are not proof that code compiles or passes tests. | ||
|
|
||
| If setup fails, check Node/npm in Toolchains, Git availability, install-script permissions and the | ||
| absolute repository path. Change the path through MCP setup, not your shell environment. | ||
| Use **Review update** to change an installed package; editing the source checkout does not update | ||
| its installed snapshot. Disable or uninstall the plugin to remove its active integration. | ||
| Uninstalling does not erase earlier conversations, npm downloads or Sem's local cache. | ||
|
|
||
| The example files use DeepChat's Apache-2.0 license; Sem is distributed separately under its own | ||
| license. This example is contributed by Sem's maintainer at Ataraxy Labs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: ThinkInAIXYZ/deepchat
Length of output: 11841
🌐 Web query:
"@ataraxy-labs/sem" "0.27.0" SEM_NO_NETWORK SEM_NO_TELEMETRY💡 Result:
🏁 Script executed:
Repository: ThinkInAIXYZ/deepchat
Length of output: 14063
🏁 Script executed:
Repository: ThinkInAIXYZ/deepchat
Length of output: 10774
🏁 Script executed:
Repository: ThinkInAIXYZ/deepchat
Length of output: 10766
🏁 Script executed:
Repository: ThinkInAIXYZ/deepchat
Length of output: 42501
🏁 Script executed:
Repository: ThinkInAIXYZ/deepchat
Length of output: 42649
🏁 Script executed:
Repository: ThinkInAIXYZ/deepchat
Length of output: 24737
🏁 Script executed:
Repository: ThinkInAIXYZ/deepchat
Length of output: 24737
🏁 Script executed:
Repository: ThinkInAIXYZ/deepchat
Length of output: 4066
🏁 Script executed:
Repository: ThinkInAIXYZ/deepchat
Length of output: 4066
Add
SEM_LOCAL=1to the Sem MCP environment.SEM_NO_NETWORK=1does not disable cloud routing for all MCP tools in Sem0.27.0. When the local index declines a repository-root entity listing,sem_entitiescan call Sem Cloud if credentials exist. This contradicts the README claim that the preset disables Sem cloud access.Suggested fix
"SEM_REPO": "${SEM_REPO}", "SEM_NO_NETWORK": "1", + "SEM_LOCAL": "1", "SEM_NO_TELEMETRY": "1"📝 Committable suggestion
🤖 Prompt for AI Agents