agent-files
v1.0.1
Published
A library that provides, detects and parses files used by coding agents and other AI tools so you don't have to reinvent the track them yourself
Readme
Features
- 🔍 MCP Discovery: Automatically detect MCP servers across various AI applications and agentic IDEs based on pre-known file path registry.
- 📁 Directory Bubbling: Intelligent discovery of project-scoped MCP configs from nested directories, supporting project-scoped MCP Server configuration and global configurations.
- ✅ MCP Linter: Lint and validate MCP configuration files to ensure they are well-formed.
- 📝 MCP Parser: Parse
mcp.jsonfiles from different IDEs and tools.
Example usage with ./examples/mcp-config-parser.js:
$ node examples/mcp-config-parser.js
Attempting to parse: ~/repos/agent-files/examples/mcp.json
Parsed configuration result:
{
"raw": {
"servers": [
{
"protocol": "http",
"port": 8080
}
]
},
"parsed": true,
"valid": true,
"servers": {
"0": {
"name": "0",
"command": ""
}
}
}
Is the configuration file syntax valid? true
Number of servers found: 1Usage: API
Install the package:
npm install agent-filesExample usage:
import { MCPPathRegistry, MCPConfigParser, DirectoryBubbleService } from 'agent-files';
// Find all mcp.json files
const bubbleService = new DirectoryBubbleService();
const mcpFiles = await bubbleService.findMCPFiles();
// Parse the files
const parser = new MCPConfigParser();
for (const file of mcpFiles) {
const config = await parser.parse(file);
console.log(config);
}Documentation
For detailed information about the project architecture and features:
- Project Overview: Comprehensive project analysis and architecture
- Design Documentation: Technical design decisions and implementation details
- Requirements: Functional and non-functional requirements
Author
agent-files © Liran Tal, Released under the Apache-2.0 License.
