Skip to content

Commit 63d058c

Browse files
committed
update readme
2 parents 4fb85e5 + deacc07 commit 63d058c

File tree

16 files changed

+1354
-270
lines changed

16 files changed

+1354
-270
lines changed

README.md

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ These servers aim to demonstrate MCP features and the Typescript and Python SDK.
2424
- **[PostgreSQL](src/postgres)** - Read-only database access with schema inspection
2525
- **[Puppeteer](src/puppeteer)** - Browser automation and web scraping
2626
- **[Sentry](src/sentry)** - Retrieving and analyzing issues from Sentry.io
27-
- **[Sequential Thinking](src/sequential-thinking)** - Dynamic and reflective problem-solving through thought sequences
27+
- **[Sequential Thinking](src/sequentialthinking)** - Dynamic and reflective problem-solving through thought sequences
2828
- **[Slack](src/slack)** - Channel management and messaging capabilities
2929
- **[Sqlite](src/sqlite)** - Database interaction and business intelligence capabilities
3030

@@ -34,8 +34,11 @@ These servers aim to demonstrate MCP features and the Typescript and Python SDK.
3434

3535
Official integrations are maintained by companies building production ready MCP servers for their platforms.
3636

37+
- <img height="12" width="12" src="https://axiom.co/favicon.ico" alt="Axiom Logo" /> **[Axiom](https://github.com/axiomhq/mcp-server-axiom)** - Query and analyze your Axiom logs, traces, and all other event data in natural language
38+
- <img height="12" width="12" src="https://browserbase.com/favicon.ico" alt="Browserbase Logo" /> **[Browserbase](https://github.com/browserbase/mcp-server-browserbase)** - Automate browser interactions in the cloud (e.g. web navigation, data extraction, form filling, and more)
3739
- <img height="12" width="12" src="https://cdn.simpleicons.org/cloudflare" /> **[Cloudflare](https://github.com/cloudflare/mcp-server-cloudflare)** - Deploy, configure & interrogate your resources on the Cloudflare developer platform (e.g. Workers/KV/R2/D1)
3840
- **[Raygun](https://github.com/MindscapeHQ/mcp-server-raygun)** - Interact with your crash reporting and real using monitoring data on your Raygun account
41+
- **[Obsidian Markdown Notes](https://github.com/calclavia/mcp-obsidian)** - Read and search through your Obsidian vault or any directory containing Markdown notes
3942
- <img height="12" width="12" src="https://e2b.dev/favicon.ico" alt="E2B Logo" /> **[E2B](https://github.com/e2b-dev/mcp-server)** - Run code in secure sandboxes hosted by [E2B](https://e2b.dev)
4043
- **[Neon](https://github.com/neondatabase/mcp-server-neon)** - Interact with the Neon serverless Postgres platform
4144
- <img height="12" width="12" src="https://www.tinybird.co/favicon.ico" alt="Tinybird Logo" /> **[Tinybird](https://github.com/tinybirdco/mcp-tinybird)** - Interact with Tinybird serverless ClickHouse platform
@@ -49,30 +52,42 @@ A growing set of community-developed and maintained servers demonstrates various
4952
> **Note:** Community servers are **untested** and should be used at **your own risk**. They are not affiliated with or endorsed by Anthropic.
5053
5154
- **[MCP Installer](https://github.com/anaisbetts/mcp-installer)** - This server is a server that installs other MCP servers for you.
52-
- **[Spotify MCP](https://github.com/varunneal/spotify-mcp)** - This MCP allows an LLM to play and use Spotify.
55+
- **[Spotify](https://github.com/varunneal/spotify-mcp)** - This MCP allows an LLM to play and use Spotify.
5356
- **[Inoyu](https://github.com/sergehuber/inoyu-mcp-unomi-server)** - Interact with an Apache Unomi CDP customer data platform to retrieve and update customer profiles
57+
- **[Snowflake](https://github.com/datawiz168/mcp-snowflake-service)** - This MCP server enables LLMs to interact with Snowflake databases, allowing for secure and controlled data operations.
5458
- **[MySQL](https://github.com/designcomputer/mysql_mcp_server)** - MySQL database integration with configurable access controls and schema inspection
59+
- **[MSSQL](https://github.com/aekanun2020/mcp-server/)** - MSSQL database integration with configurable access controls and schema inspection
5560
- **[BigQuery](https://github.com/LucasHild/mcp-server-bigquery)** (by LucasHild) - This server enables LLMs to inspect database schemas and execute queries on BigQuery.
5661
- **[BigQuery](https://github.com/ergut/mcp-bigquery-server)** (by ergut) - Server implementation for Google BigQuery integration that enables direct BigQuery database access and querying capabilities
5762
- **[Todoist](https://github.com/abhiz123/todoist-mcp-server)** - Interact with Todoist to manage your tasks.
63+
- **[Tavily search](https://github.com/RamXX/mcp-tavily")** - An MCP server for Tavily's search & news API, with explicit site inclusions/exclusions
5864
- **[Linear](https://github.com/jerhadf/linear-mcp-server)** - Allows LLM to interact with Linear's API for project management, including searching, creating, and updating issues.
59-
- **[Playwright MCP](https://github.com/executeautomation/mcp-playwright)** - This MCP Server will help you run browser automation and webscraping using Playwright
65+
- **[Playwright](https://github.com/executeautomation/mcp-playwright)** - This MCP Server will help you run browser automation and webscraping using Playwright
6066
- **[AWS](https://github.com/rishikavikondala/mcp-server-aws)** - Perform operations on your AWS resources using an LLM
6167
- **[LlamaCloud](https://github.com/run-llama/mcp-server-llamacloud)** (by marcusschiesser) - Integrate the data stored in a managed index on [LlamaCloud](https://cloud.llamaindex.ai/)
6268
- **[Any Chat Completions](https://github.com/pyroprompts/any-chat-completions-mcp)** - Interact with any OpenAI SDK Compatible Chat Completions API like OpenAI, Perplexity, Groq, xAI and many more.
6369
- **[Windows CLI](https://github.com/SimonB97/win-cli-mcp-server)** - MCP server for secure command-line interactions on Windows systems, enabling controlled access to PowerShell, CMD, and Git Bash shells.
6470
- **[OpenRPC](https://github.com/shanejonas/openrpc-mpc-server)** - Interact with and discover JSON-RPC APIs via [OpenRPC](https://open-rpc.org).
65-
- **[ChatSum](https://github.com/mcpservers/mcp-server-chatsum)** - Query and Summarize wechat messages with LLM.
71+
- **[FireCrawl](https://github.com/vrknetha/mcp-server-firecrawl)** - Advanced web scraping with JavaScript rendering, PDF support, and smart rate limiting
72+
- **[AlphaVantage](https://github.com/calvernaz/alphavantage)** - MCP server for stock market data API [AlphaVantage](https://www.alphavantage.co)
73+
- **[Docker](https://github.com/ckreiling/mcp-server-docker)** - Integrate with Docker to manage containers, images, volumes, and networks.
74+
- **[Kubernetes](https://github.com/Flux159/mcp-server-kubernetes)** - Connect to Kubernetes cluster and manage pods, deployments, and services.
75+
- **[OpenAPI](https://github.com/snaggle-ai/openapi-mcp-server)** - Interact with [OpenAPI](https://www.openapis.org/) APIs.
76+
- **[Pandoc](https://github.com/vivekVells/mcp-pandoc)** - MCP server for seamless document format conversion using Pandoc, supporting Markdown, HTML, and plain text, with other formats like PDF, csv and docx in development.
77+
- **[ChatSum](https://github.com/mcpso/mcp-server-chatsum)** - Query and Summarize chat messages with LLM.
78+
6679

6780
## 📚 Resources
6881

6982
Additional resources on MCP.
7083

71-
- **[Awesome MCP Servers by punkpeye](https://github.com/punkpeye/awesome-mcp-servers)** - A curated list of MCP servers by **[Frank Fiegel](https://github.com/punkpeye)**
72-
- **[Awesome MCP Servers by wong2](https://github.com/wong2/awesome-mcp-servers)** - A curated list of MCP servers by **[wong2](https://github.com/wong2)**
84+
- **[Awesome MCP Servers by punkpeye](https://github.com/punkpeye/awesome-mcp-servers)** (**[website](https://glama.ai/mcp/servers)**) - A curated list of MCP servers by **[Frank Fiegel](https://github.com/punkpeye)**
85+
- **[Awesome MCP Servers by wong2](https://github.com/wong2/awesome-mcp-servers)** (**[website](https://mcpservers.org)**) - A curated list of MCP servers by **[wong2](https://github.com/wong2)**
7386
- **[Awesome MCP Servers by appcypher](https://github.com/appcypher/awesome-mcp-servers)** - A curated list of MCP servers by **[Stephen Akinyemi](https://github.com/appcypher)**
87+
- **[Discord Server](https://glama.ai/mcp/discord)** – A community discord server dedicated to MCP by **[Frank Fiegel](https://github.com/punkpeye)**
7488
- **[mcp-get](https://mcp-get.com)** - Command line tool for installing and managing MCP servers by **[Michael Latman](https://github.com/michaellatman)**
7589
- **[mcp-cli](https://github.com/wong2/mcp-cli)** - A CLI inspector for the Model Context Protocol by **[wong2](https://github.com/wong2)**
90+
- **[r/mcp](https://www.reddit.com/r/mcp)** – A Reddit community dedicated to MCP by **[Frank Fiegel](https://github.com/punkpeye)**
7691

7792
## 🚀 Getting Started
7893

package-lock.json

Lines changed: 28 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/filesystem/README.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,30 @@ Node.js server implementing Model Context Protocol (MCP) for filesystem operatio
3636
- `path` (string): File location
3737
- `content` (string): File content
3838

39+
- **edit_file**
40+
- Make selective edits using advanced pattern matching and formatting
41+
- Features:
42+
- Line-based and multi-line content matching
43+
- Whitespace normalization with indentation preservation
44+
- Fuzzy matching with confidence scoring
45+
- Multiple simultaneous edits with correct positioning
46+
- Indentation style detection and preservation
47+
- Git-style diff output with context
48+
- Preview changes with dry run mode
49+
- Failed match debugging with confidence scores
50+
- Inputs:
51+
- `path` (string): File to edit
52+
- `edits` (array): List of edit operations
53+
- `oldText` (string): Text to search for (can be substring)
54+
- `newText` (string): Text to replace with
55+
- `dryRun` (boolean): Preview changes without applying (default: false)
56+
- `options` (object): Optional formatting settings
57+
- `preserveIndentation` (boolean): Keep existing indentation (default: true)
58+
- `normalizeWhitespace` (boolean): Normalize spaces while preserving structure (default: true)
59+
- `partialMatch` (boolean): Enable fuzzy matching (default: true)
60+
- Returns detailed diff and match information for dry runs, otherwise applies changes
61+
- Best Practice: Always use dryRun first to preview changes before applying them
62+
3963
- **create_directory**
4064
- Create new directory or ensure it exists
4165
- Input: `path` (string)
@@ -98,4 +122,4 @@ Add this to your `claude_desktop_config.json`:
98122

99123
## License
100124

101-
This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository.
125+
This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository.

src/filesystem/index.ts

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import path from "path";
1212
import os from 'os';
1313
import { z } from "zod";
1414
import { zodToJsonSchema } from "zod-to-json-schema";
15+
import { diffLines, createTwoFilesPatch } from 'diff';
1516

1617
// Command line argument parsing
1718
const args = process.argv.slice(2);
@@ -106,6 +107,17 @@ const WriteFileArgsSchema = z.object({
106107
content: z.string(),
107108
});
108109

110+
const EditOperation = z.object({
111+
oldText: z.string().describe('Text to search for - must match exactly'),
112+
newText: z.string().describe('Text to replace with')
113+
});
114+
115+
const EditFileArgsSchema = z.object({
116+
path: z.string(),
117+
edits: z.array(EditOperation),
118+
dryRun: z.boolean().default(false).describe('Preview changes using git-style diff format')
119+
});
120+
109121
const CreateDirectoryArgsSchema = z.object({
110122
path: z.string(),
111123
});
@@ -202,6 +214,104 @@ async function searchFiles(
202214
return results;
203215
}
204216

217+
// file editing and diffing utilities
218+
function normalizeLineEndings(text: string): string {
219+
return text.replace(/\r\n/g, '\n');
220+
}
221+
222+
function createUnifiedDiff(originalContent: string, newContent: string, filepath: string = 'file'): string {
223+
// Ensure consistent line endings for diff
224+
const normalizedOriginal = normalizeLineEndings(originalContent);
225+
const normalizedNew = normalizeLineEndings(newContent);
226+
227+
return createTwoFilesPatch(
228+
filepath,
229+
filepath,
230+
normalizedOriginal,
231+
normalizedNew,
232+
'original',
233+
'modified'
234+
);
235+
}
236+
237+
async function applyFileEdits(
238+
filePath: string,
239+
edits: Array<{oldText: string, newText: string}>,
240+
dryRun = false
241+
): Promise<string> {
242+
// Read file content and normalize line endings
243+
const content = normalizeLineEndings(await fs.readFile(filePath, 'utf-8'));
244+
245+
// Apply edits sequentially
246+
let modifiedContent = content;
247+
for (const edit of edits) {
248+
const normalizedOld = normalizeLineEndings(edit.oldText);
249+
const normalizedNew = normalizeLineEndings(edit.newText);
250+
251+
// If exact match exists, use it
252+
if (modifiedContent.includes(normalizedOld)) {
253+
modifiedContent = modifiedContent.replace(normalizedOld, normalizedNew);
254+
continue;
255+
}
256+
257+
// Otherwise, try line-by-line matching with flexibility for whitespace
258+
const oldLines = normalizedOld.split('\n');
259+
const contentLines = modifiedContent.split('\n');
260+
let matchFound = false;
261+
262+
for (let i = 0; i <= contentLines.length - oldLines.length; i++) {
263+
const potentialMatch = contentLines.slice(i, i + oldLines.length);
264+
265+
// Compare lines with normalized whitespace
266+
const isMatch = oldLines.every((oldLine, j) => {
267+
const contentLine = potentialMatch[j];
268+
return oldLine.trim() === contentLine.trim();
269+
});
270+
271+
if (isMatch) {
272+
// Preserve original indentation of first line
273+
const originalIndent = contentLines[i].match(/^\s*/)?.[0] || '';
274+
const newLines = normalizedNew.split('\n').map((line, j) => {
275+
if (j === 0) return originalIndent + line.trimStart();
276+
// For subsequent lines, try to preserve relative indentation
277+
const oldIndent = oldLines[j]?.match(/^\s*/)?.[0] || '';
278+
const newIndent = line.match(/^\s*/)?.[0] || '';
279+
if (oldIndent && newIndent) {
280+
const relativeIndent = newIndent.length - oldIndent.length;
281+
return originalIndent + ' '.repeat(Math.max(0, relativeIndent)) + line.trimStart();
282+
}
283+
return line;
284+
});
285+
286+
contentLines.splice(i, oldLines.length, ...newLines);
287+
modifiedContent = contentLines.join('\n');
288+
matchFound = true;
289+
break;
290+
}
291+
}
292+
293+
if (!matchFound) {
294+
throw new Error(`Could not find exact match for edit:\n${edit.oldText}`);
295+
}
296+
}
297+
298+
// Create unified diff
299+
const diff = createUnifiedDiff(content, modifiedContent, filePath);
300+
301+
// Format diff with appropriate number of backticks
302+
let numBackticks = 3;
303+
while (diff.includes('`'.repeat(numBackticks))) {
304+
numBackticks++;
305+
}
306+
const formattedDiff = `${'`'.repeat(numBackticks)}diff\n${diff}${'`'.repeat(numBackticks)}\n\n`;
307+
308+
if (!dryRun) {
309+
await fs.writeFile(filePath, modifiedContent, 'utf-8');
310+
}
311+
312+
return formattedDiff;
313+
}
314+
205315
// Tool handlers
206316
server.setRequestHandler(ListToolsRequestSchema, async () => {
207317
return {
@@ -233,6 +343,14 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
233343
"Handles text content with proper encoding. Only works within allowed directories.",
234344
inputSchema: zodToJsonSchema(WriteFileArgsSchema) as ToolInput,
235345
},
346+
{
347+
name: "edit_file",
348+
description:
349+
"Make line-based edits to a text file. Each edit replaces exact line sequences " +
350+
"with new content. Returns a git-style diff showing the changes made. " +
351+
"Only works within allowed directories.",
352+
inputSchema: zodToJsonSchema(EditFileArgsSchema) as ToolInput,
353+
},
236354
{
237355
name: "create_directory",
238356
description:
@@ -346,6 +464,18 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
346464
};
347465
}
348466

467+
case "edit_file": {
468+
const parsed = EditFileArgsSchema.safeParse(args);
469+
if (!parsed.success) {
470+
throw new Error(`Invalid arguments for edit_file: ${parsed.error}`);
471+
}
472+
const validPath = await validatePath(parsed.data.path);
473+
const result = await applyFileEdits(validPath, parsed.data.edits, parsed.data.dryRun);
474+
return {
475+
content: [{ type: "text", text: result }],
476+
};
477+
}
478+
349479
case "create_directory": {
350480
const parsed = CreateDirectoryArgsSchema.safeParse(args);
351481
if (!parsed.success) {

src/filesystem/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,13 @@
1919
"watch": "tsc --watch"
2020
},
2121
"dependencies": {
22-
"@modelcontextprotocol/sdk": "1.0.1",
22+
"@modelcontextprotocol/sdk": "0.5.0",
23+
"diff": "^5.1.0",
2324
"glob": "^10.3.10",
2425
"zod-to-json-schema": "^3.23.5"
2526
},
2627
"devDependencies": {
28+
"@types/diff": "^5.0.9",
2729
"@types/node": "^20.11.0",
2830
"shx": "^0.3.4",
2931
"typescript": "^5.3.3"

0 commit comments

Comments
 (0)