Simple Python MCP server for file search with VSCode integration
The FileFinder MCP (Model Context Protocol) server is a Python-based application designed to facilitate the search and retrieval of files based on partial path fragments within the file system. This server adheres to the Model Context Protocol, enabling seamless integration and data access for a variety of AI applications such as Claude Desktop, Continue, Cursor, and others.
The FileFinder MCP server is characterized by its robust capabilities in searching and returning files in JSON format. It supports real-time searches based on user-defined parameters, ensuring efficient and accurate data retrieval. This server’s integration with the Model Context Protocol enables AI applications to query file paths without the need for custom scripting.
Users can initiate a search using a partial path fragment as input. For example:
curl "http://localhost:8080/?path=example"
or through postman requests:
http://localhost:8080/?path=readme
Upon execution, the server processes the request and returns matching file entries in JSON format.
The response from the server is structured as a list of dictionaries, each representing a file with relevant details such as name, path, size, and creation date:
[
{
"name": "readme.markdown",
"path": "/AdobePhotoshop\\Adobe\\Adobe Photoshop CC 2019\\Required\\Generator-builtin\\node_modules\\optimist\\readme.markdown",
"size": 11208,
"creation_date": "2019-10-17T15:25:58Z"
},
{
"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-17T15:25:58Z"
},
// Additional file entries
]
The FileFinder MCP server is architected to align with the Model Context Protocol’s standards, ensuring seamless interaction between AI applications and data sources. The protocol flow can be visualized as follows:
graph TD
A[AI Application] -->|MCP Client| B[MCP Protocol]
B --> C[MCP Server]
C --> D[Data Source/Tool]
style A fill:#e1f5fe
style C fill:#f3e5f5
style D fill:#e8f5e8
This diagram illustrates how an AI application uses the MCP client to interact with the MCP protocol, which then routes requests to the corresponding server and ultimately retrieves data from the designated source.
To set up the FileFinder MCP server on your system:
file_finder_mcp.py
script.file_finder_mcp.py
.python file_finder_mcp.py
The server will start running on port 8080, and you should see the message:
Starting MCP server on port 8080...
Here are two realistic examples of how FileFinder can be integrated into AI workflows:
Developers often need to quickly locate specific files within a project directory structure. With the FileFinder MCP server, developers can initiate searches using a partial path fragment and receive relevant results in real time.
curl "http://localhost:8080/?path=src/app.js"
The response might look like this:
[
{
"name": "app.js",
"path": "/DevelopmentProjects\\MyProject\\src\\app.js",
"size": 5321,
"creation_date": "2021-10-30T14:20:48Z"
},
{
"name": "app.js",
"path": "/DevelopmentProjects\\MyOtherProject\\src\\app.js",
"size": 6325,
"creation_date": "2021-11-15T15:30:48Z"
},
]
In a data processing environment, automated logging might require frequent updates to files. The FileFinder MCP server can be employed to monitor and retrieve these logs in real-time, ensuring that all relevant data is always up-to-date.
To integrate the FileFinder MCP server with an MCP client (such as Claude Desktop or Continue):
python file_finder_mcp.py
Create or modify a .vscode/cline-config.json
file with configuration details:
{
"mcpServers": {
"file-finder-mcp": {
"args": [
"python",
"file_finder_mcp.py"
],
"command": "python",
"autoApprove": [],
"disabled": false
}
}
}
Save the file, and VSCode should automatically connect to the MCP server.
The FileFinder MCP server is compatible with a range of MCP clients. Below is an example compatibility matrix:
MCP Client | Resources | Tools | Prompts |
---|---|---|---|
Claude Desktop | ✅ | ✅ | ✅ |
Continue | ✅ | ✅ | ✅ |
Cursor | ❌ | ✅ | ❌ |
This matrix ensures that developers can leverage the strengths of different tools and resources while maintaining consistency in data access.
For advanced usage, you may need to adjust the configuration based on your specific needs. Here are a few additional steps:
A1: The server is designed to be compatible with Claude Desktop, Continue, and Cursor. However, for more limited features in some clients, refer to the compatibility matrix provided.
A2: Security concerns require implementing authentication and authorization mechanisms. Review the documentation for detailed steps on securing connections.
A3: Yes, you can modify the server code to change the structure or content of the JSON responses as needed.
A4: For larger datasets, consider optimizing indexing and query performance to ensure efficient data retrieval.
A5: While the server is generally reliable, issues may arise from version mismatches or unexpected configurations. Refer to the official documentation for troubleshooting tips.
To contribute to the development of the FileFinder MCP server:
We welcome contributions from the community to enhance the functionality and usability of the FileFinder.
The wider MCP ecosystem includes a variety of tools, servers, and clients that work together to provide a unified platform for AI developers. Resources like documentation, tutorials, and community forums are available to help you get started and stay informed about the latest developments in the field.
By leveraging the FileFinder MCP server, developers can significantly streamline their development process and enhance their integration with various AI tools.
RuinedFooocus is a local AI image generator and chatbot image server for seamless creative control
Simplify MySQL queries with Java-based MysqlMcpServer for easy standard input-output communication
Learn to set up MCP Airflow Database server for efficient database interactions and querying airflow data
Build stunning one-page websites track engagement create QR codes monetize content easily with Acalytica
Explore CoRT MCP server for advanced self-arguing AI with multi-LLM inference and enhanced evaluation methods
Access NASA APIs for space data, images, asteroids, weather, and exoplanets via MCP integration