- Home
- MCP servers
- Source Code
Source Code
- javascript
1
GitHub Stars
javascript
Language
6 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"chakotay-lee-mcp-source-server": {
"command": "node",
"args": [
"/path/to/your/mcp-source-server/dist/index.js"
],
"env": {
"MCP_WORKSPACE_DIR": "/path/to/your/workspace"
}
}
}
}You deploy a lightweight MCP server that lets an AI assistant inspect and modify your project files through safe, auditable operations. It enables read, write, list, and advanced actions like delete, rename, and partial updates, while enforcing security bounds and file-size limits. This makes AI-assisted development smoother by reducing repetitive copy-paste tasks and keeping changes organized within a dedicated workspace.
How to use
You will use an MCP client to communicate with the source code MCP server. The server exposes a set of operations that let your AI assistant read, write, list, delete, rename, and partially update files inside a specified workspace. All actions respect security rules like allowed file extensions and directory traversal prevention. Use the provided JSON/HTTP/stdio entry points to run the server, then perform file operations from your MCP client by calling the corresponding tools.
How to install
Prerequisites: Node.js installed on your system. You also need npm to install dependencies and build the project.
-
Clone the MCP source server repository.
-
Change into the project directory.
-
Install dependencies.
-
Build the project.
-
Run tests.
Concrete commands you should run (one per line):
# Clone the repository
git clone git@hgithub.com/Chakotay-Lee/mcp-source-server
cd mcp-source-server
# Install dependencies
npm install
# Build the project
npm run build
# Run tests
npm test
Claude Desktop configuration
Configure Claude Desktop to connect to the MCP server by adding an entry to your Claude configuration. Use the exact paths shown here as examples and replace with your actual paths.
{
"mcpServers": {
"source-code-server": {
"command": "node",
"args": ["/path/to/your/mcp-source-server/dist/index.js"],
"env": {
"MCP_WORKSPACE_DIR": "/path/to/your/workspace"
}
}
}
}
Configuration and security
Workspace and security settings help protect your project while enabling useful automation. Set a dedicated workspace directory for the MCP server, and enforce file-type and path restrictions to prevent unsafe operations.
Environment variable to configure the workspace directory (default is ./workspace): MCP_WORKSPACE_DIR.
Security features include: directory traversal protection, a file extension whitelist, path blacklisting, size limits, and concurrent operation limits.
Examples of allowed and protected paths are shown in the following examples to help you tailor security to your project structure.
Usage patterns and examples
Read a file, write a file, or list files in your workspace using the MCP client. The following commands illustrate common operations you can perform through the MCP server.
-
Read a file: read_source_file with a file path inside the workspace.
-
Write a file: write_source_file with the target path and content; you may request a backup.
-
List files: list_source_files to browse the workspace directory.
Backup and reliability
Backups are created automatically in the workspace under .backups with a timestamped filename, e.g., filename.timestamp.backup. Regularly review and clean up old backups to manage disk usage.
If you need to restore a previous version, locate the relevant backup in the .backups folder and restore it to the original path.
Troubleshooting tips
If you encounter permission or path errors, verify that MCP_WORKSPACE_DIR points to an existing directory within your project and that file operations stay within the workspace. Check that file extensions and paths do not violate the security rules.
Available tools
read_source_file
Read file content from the workspace and return its content to the MCP client.
write_source_file
Write content to a file within the workspace, with an option to create a backup.
list_source_files
List files in a directory inside the workspace with metadata.
stream_write_source_file
Stream large file content to a destination file inside the workspace.
delete_source_file
Delete a file within the workspace with an automatic backup.
rename_source_file
Rename or move a file within the workspace, optionally creating a backup.
partial_write_source_file
Update specific sections of a file efficiently to minimize I/O.
get_server_stats
Retrieve the current status and statistics of the MCP server.