
Security News
npm Tooling Bug Incorrectly Marks One-Character Packages as Security Holders
npm confirmed a tooling bug incorrectly marked several one-character packages as security holders and said it was working on a rollback.
morph-codeseek
Advanced tools
AI-powered code search MCP server for Cursor - find any code using natural language
TypeScript implementation of the Morph code-search subagent packaged as a Model Context Protocol (MCP) server. The server runs the three-round grep/search workflow defined in common/system_prompt.py, using fast local tools (analyse, read, grep, finish) to collect context for a natural-language query against a repository.
common/).@vscode/ripgrep for fast repo-wide regex search, plus cached analyse and read utilities./v1/chat/completions endpoint (local vLLM, OpenRouter, etc.).Get your Morph API key from https://morphllm.com/dashboard/api-keys
Add to .cursor/mcp.json (or ~/.cursor/mcp.json for global):
{
"mcpServers": {
"morph-fast-context": {
"command": "npx",
"args": ["-y", "morph-codeseek"],
"env": {
"GREP_AGENT_API_KEY": "sk-your-morph-api-key-here"
}
}
}
}
Reload Cursor (Cmd+Shift+P → "Developer: Reload Window")
That's it! The server is pre-configured with Morph's production infrastructure.
cd morph-mcp/grep-agent
npm install # builds `dist/` via the prepare script
npm test # run tests
npm start # run server locally
| Variable | Description | Default |
|---|---|---|
GREP_AGENT_API_KEY | Your Morph API key | (required) |
GREP_AGENT_HOST_URL | Override inference server URL | http://192.222.50.122:8080 |
GREP_AGENT_MODEL | Override model name | fast-grep-303 |
MORPH_DEBUG | Enable debug logging (true/1) | disabled |
GREP_AGENT_DEBUG_DIR | Custom debug log directory | {tmpdir}/morph-codeseek-debug |
run_grep_agent({
repoPath: "/absolute/path/to/repo",
query: "Where do we validate JWT refresh tokens?"
})
The tool returns the relevant code snippets found, formatted as XML blocks with line numbers.
The MCP server returns a structured response showing:
Example successful response:
Morph Fast Context subagent performed search on repository:
- Grepped 'validate.*token' in `src`
- Grepped 'jwt' in `.`
- Read file `src/auth/jwt.ts:1-50`
- Analysed directory `src/auth`
- Grepped 'authMiddleware' in `src`
- Read file `src/middleware/auth.ts:10-30`
- Read file `src/auth/jwt.ts:75-90`
Relevant context found:
- src/auth/jwt.ts:25-31,75-78
- src/middleware/auth.ts:10-22
Here is the content of files:
<file path="src/auth/jwt.ts">
25| export function validateToken(token: string) {
26| const decoded = jwt.verify(token, SECRET_KEY);
27| if (!decoded || !decoded.exp) {
28| throw new Error('Invalid token');
29| }
30| return decoded;
31| }
75| export function refreshToken(oldToken: string) {
76| const payload = validateToken(oldToken);
77| return generateToken(payload.userId);
78| }
</file>
<file path="src/middleware/auth.ts">
10| export const authMiddleware = (req, res, next) => {
11| const token = req.headers.authorization?.split(' ')[1];
12| if (!token) {
13| return res.status(401).json({ error: 'No token provided' });
14| }
15| try {
16| const user = validateToken(token);
17| req.user = user;
18| next();
19| } catch (err) {
20| return res.status(401).json({ error: 'Invalid token' });
21| }
22| };
</file>
When the agent finds relevant code, the response contains three sections:
Search Actions: Shows what the Morph Fast Context subagent did during exploration
Grepped '...' in '...' - Searched for a regex pattern in a directory or fileRead file '...' - Read specific file or line rangesAnalysed directory '...' - Explored directory structureFile List: Compact summary of all files found with their line ranges in format path:start-end,start-end
File Contents: Full XML blocks with actual code content and line numbers from the identified locations
If the agent completes all rounds without calling the finish tool:
Agent completed 4 rounds but did not call finish tool.
If an error occurs during the agent's execution:
Error: LLM request failed with status 500
The agent follows a 4-round workflow:
Rounds 1-3: Exploration using grep, read, and analyse tools
Finish Reminder: After round 3, the agent is prompted to call finish
Round 4: Final round where the agent calls finish with identified file locations
The XML response automatically includes the actual code content from the line ranges the agent identified.
Debug logging is disabled by default for optimal performance. To enable detailed logging, set MORPH_DEBUG=true (or MORPH_DEBUG=1) in your environment:
{
"mcpServers": {
"morph-fast-context": {
"command": "npx",
"args": ["-y", "morph-codeseek"],
"env": {
"GREP_AGENT_API_KEY": "sk-your-morph-api-key-here",
"MORPH_DEBUG": "true"
}
}
}
}
When enabled, detailed logs are saved to {tmpdir}/morph-codeseek-debug/ (customizable via GREP_AGENT_DEBUG_DIR):
session-{timestamp}-{id}.log: Human-readable logs with timestamps and contextsession-{timestamp}-{id}.jsonl: Structured JSONL logs for programmatic analysissession-{timestamp}-{id}-messages.json: Complete conversation history including all messages exchanged between system, user, and assistantThese logs are useful for debugging, performance analysis, and understanding the agent's decision-making process.
npm test # Jest unit tests for parser, helpers, grep tool, formatter
npm run build # Type-check and emit ESM to dist/
src/ (ESM, Node >=18).src/__tests__/ and run under ts-jest.@vscode/ripgrep; no system dependency is required.common/utils.Follow these steps to wire the server into Windsurf’s Cascade MCP host:
Check prerequisites
fetch)morph-mcp submodule) cloned locallynode --version and npm --versionInstall dependencies & build
cd morph-mcp/grep-agent
npm install # runs tsc via the prepare script and emits dist/server.js
Re-run npm run build after any source changes.
Register the server in Windsurf Cascade
node, Args ["/lambda/nfs/embeddings/dat/workspace/swe-grep/dat_sft/morph-mcp/grep-agent/dist/server.js"], and no working directory needed.Editing the Cascade JSON directly:
{
"mcpServers": {
"morph-fast-context": {
"command": "node",
"args": [
"/lambda/nfs/embeddings/dat/workspace/swe-grep/dat_sft/morph-mcp/grep-agent/dist/server.js"
],
"env": {
"GREP_AGENT_HOST_URL": "http://localhost:8000",
"GREP_AGENT_MODEL": "/model"
}
}
}
}
Adjust the environment variables to match your setup. Cascade applies the configuration after you press Refresh.
Set optional environment overrides (in Cascade’s env section, for STDIO launches)
| Variable | Description | Default |
|---|---|---|
GREP_AGENT_HOST_URL | Base URL for your OpenAI-compatible endpoint | http://localhost:8000 |
GREP_AGENT_MODEL | Model identifier | /model |
(You can supply apiKey directly in the tool call if authentication is required.)
Validate the setup
analyse/grep/read calls, then finish with a summary.If the STDIO server exits early, run it manually to inspect logs:
node /lambda/nfs/embeddings/dat/workspace/swe-grep/dat_sft/morph-mcp/grep-agent/dist/server.js
Stay current
npm install to pick up new deps.npm test to run the Jest suite (includes an integration test for runAgent).Follow these steps to wire the server into Cursor’s MCP host:
Check prerequisites
fetch)morph-mcp submodule) cloned locallynode --version and npm --versionInstall dependencies & build
cd morph-mcp/grep-agent
npm install # runs tsc via the prepare script and emits dist/server.js
Re-run npm run build after you change TypeScript sources so dist/server.js stays current.
Pick a configuration scope
~/.cursor/mcp.json to expose the server in every project..cursor/mcp.json in the project root (the folder Cursor opens).${workspaceFolder} / ${workspaceFolderBasename} and ${env:VAR_NAME} inside the JSON.Add the server definition
{
"mcpServers": {
"morph-fast-context": {
"command": "node",
"args": [
"/lambda/nfs/embeddings/dat/workspace/swe-grep/dat_sft/morph-mcp/grep-agent/dist/server.js"
],
"transport": "stdio",
"env": {
"GREP_AGENT_HOST_URL": "http://localhost:8000",
"GREP_AGENT_MODEL": "/model"
}
}
}
}
Adjust the environment variables to match your setup.
Reload Cursor and validate
morph-fast-context appears.node /lambda/nfs/embeddings/dat/workspace/swe-grep/dat_sft/morph-mcp/grep-agent/dist/server.js
Check that your LLM endpoint (http://localhost:8000/v1/chat/completions by default) is reachable and that any required API keys are present.Stay current
npm install to sync dependencies.npm test to execute the Jest suite (unit + integration coverage).npm run build before reconnecting the MCP server to regenerate dist/.FAQs
AI-powered code search MCP server for Cursor - find any code using natural language
The npm package morph-codeseek receives a total of 0 weekly downloads. As such, morph-codeseek popularity was classified as not popular.
We found that morph-codeseek demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
npm confirmed a tooling bug incorrectly marked several one-character packages as security holders and said it was working on a rollback.

Research
/Security News
Newer packages in this compromise use native extensions and .pth loaders to execute JavaScript stealers in developer environments.

Research
Socket found 37 malicious PyPI wheels that abuse Python startup hooks to launch a Bun-powered credential stealer tied to Mini Shai-Hulud/Miasma.