This MCP Toolkit server provides a comprehensive set of tools for AI assistants to interact with local systems, files, databases, and external services. It extends AI capabilities with real-world interactions while maintaining security and control.
Install the MCP Toolkit using npm:
npm install mcp-toolkit
Create a config.json
file in your project to set up workspace paths, network options, and database connections:
{
"workspace": {
"rootPath": "/path/to/workspace",
"allowedPaths": ["/allowed/path1", "/allowed/path2"]
},
"network": {
"proxy": "http://proxy-server:port" // Optional
},
"database": {
"mysql": {
"host": "localhost",
"port": 3306,
"user": "user",
"password": "password",
"database": "dbname"
}
// Similar configuration for PostgreSQL and Redis
}
}
To start the MCP server, create a simple TypeScript file:
import { Server } from 'mcp-toolkit';
const server = new Server({
configPath: './config.json'
});
server.start();
These tools help manage files and directories:
Reading Files: Access file contents
// Example of reading a file
read_file("/path/to/file.txt")
Writing Files: Create or update files
// Example of writing to a file
write_to_file("/path/to/file.txt", "File content here")
Directory Management: List and search files
// Example of listing directory contents
list_files("/path/to/directory")
// Example of searching files using regex
search_files("/path/to/directory", "*.js")
Code Analysis: Extract code definitions
// Extract code definitions from a file
list_code_definition_names("/path/to/code.js")
Connect and interact with various databases:
MySQL/PostgreSQL/Redis Support:
// Connect to a database
db_connect("mysql", {
host: "localhost",
port: 3306,
user: "user",
password: "password",
database: "dbname"
})
// Execute a query
db_query("SELECT * FROM users WHERE age > ?", [18])
Transaction Management:
// Begin a transaction
db_begin_transaction()
// Commit changes
db_commit_transaction()
// Rollback changes
db_rollback_transaction()
Work with GitHub repositories:
// List repository contents
github_ls("username/repo", "path/to/directory")
// View file contents
github_cat("username/repo", "path/to/file.js")
// Search code in repositories
github_search_code("username/repo", "search term")
Interact with web content:
// Extract webpage content
read_webpage("https://example.com")
// Execute a web search
brave_search("search query")
// Send HTTP requests
http_request("GET", "https://api.example.com/data", {
headers: { "Authorization": "Bearer token" }
})
Execute system operations:
// Run a command
execute_command("ls -la")
// Search files with Everything
everything_search("query")
// Write to logs
logger("info", "Operation completed successfully")
The MCP Toolkit includes several security measures:
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.