使用说明
MCP file search server
It is a simple MCP server written in Python that searches for files in the file system based on a path fragment and returns the results in JSON format.
Installation
- Clone this repository or download the script '
file_finder_mcp.py'. - Make sure you have Python 3.x installed on your system.
Запуск сервера
- Open the terminal and go to the directory containing '
file_finder_mcp.py'. - Start the server with the following command:
python file_finder_mcp.py
Описание
For customization Cline in VSCode to work with the presented MCP server, perform the following steps. Start by installing and configuring all the necessary components.
Step 1: Install VSCode
You have VSCode installed.
Шаг 2: Установка расширения Cline
- Open the VSCode.
- Go to the Extensions section through the sidebar or click '
Ctrl+Shift+X'. - Enter Cline in the search.
- Find the Cline extension and install it.
Шаг 3: Установка Python
Make sure you have Python 3.x installed on your computer.
Step 4: Start the MCP server
Download or create a file 'file_finder_mcp.py(Server code given above).
Open the terminal in VSCode (Ctrl+`) or use any other terminal.
Go to the folder where file_finder_mcp.py is located.
Start the server with the command:
python file_finder_mcp.py
The server will start on port 8080. You will see a message:
Starting MCP server on port 8080...
Step 5: Configure Cline to work with an MCP server
In VSCode, open the Cline configuration file. If the file does not exist, create it in the .vscode folder of your project:
The Path: '.vscode/cline-config.json'
Add the configuration for the MCP server:
{
"mcpServers": {
"file-finder-mcp": {
"args": [
"python",
"file_finder_mcp.py"
],
"command": "python",
"autoApprove": [],
"disabled": false
}
}
}
Here:
- '
command': Command to start the server (python). - '
args': Аргументы для запуска сервера (файл file_finder_mcp.py). - '
autoApprove': List of automatically approved actions (leave empty). - '
disabled': If false, the server will be active. Save the configuration file.
Шаг 6: Подключение Cline к MCP серверу
Restart VSCode to apply the configuration changes.
Make sure the MCP server is running (see Step 4).
In VSCode, open the Cline panel (if it does not open automatically).
Cline should automatically connect to the MCP server using the configuration from 'cline-config.json'.
Step 7: Sample request and response
curl "http://localhost:8080/?path=example"
or you have Postman installed. Pfgecnbnt 'GETRequest
http://localhost:8080/?path=readme
[
{
"name": "readme.markdown",
"path": "/AdobePhotoshop\\Adobe\\Adobe Photoshop CC 2019\\Required\\Generator-builtin\\node_modules\\optimist\\readme.markdown",
"size": 11208,
"creation_date": "2019-10-17 15:25:58"
},
{
"name": "readme.markdown",
"path": "/AdobePhotoshop\\Adobe\\Adobe Photoshop CC 2019\\Required\\Generator-builtin\\node_modules\\optimist\\node_modules\\minimist\\readme.markdown",
"size": 1712,
"creation_date": "2019-10-17 15:25:58"
},
{
"name": "readme.txt",
"path": "/AdobePhotoshop\\Adobe\\Adobe Photoshop CC 2019\\Required\\Linguistics\\Providers\\Plugins2\\AdobeHunspellPlugin\\dictionaries\\tr_TR\\readme.txt",
"size": 362,
"creation_date": "2019-10-17 15:56:44"
},
{
"name": "readme.md",
"path": "/AdobePhotoshop\\Adobe\\Adobe Photoshop CC 2019\\Required\\Plug-ins\\Generator\\assets.generate\\node_modules\\os-tmpdir\\readme.md",
"size": 725,
"creation_date": "2019-10-17 15:25:58"
},
]
