DllMetadataExtractor is a .NET tool designed to extract complete public API information from .NET assembly files (.dll).
It can parse detailed metadata including classes, methods, properties, signatures, and XML documentation comments, returning the result as a JSON string.
The primary use case for this tool is to provide an accurate, real-time library API definition for AI or other development tools, thereby helping to analyze and correct code, especially when API calls fail or usage is unclear.
- Complete API Extraction: Extracts classes, methods, properties, events, fields, and their signatures.
- XML Documentation Support: If a corresponding
.xmldocumentation file exists alongside the.dllfile, the tool will automatically parse and include the XML comments. - JSON Output: Outputs metadata in a structured JSON format for easy programmatic parsing.
- MCP Server: Runs as an MCP (Model Context Protocol) server, allowing for easy integration with tools that support this protocol.
You can use the build.bat script located in the project root to build this tool.
.\build.batAfter a successful build, all necessary files will be output to the publish directory.
The tool is designed to run as an MCP server over standard input/output (stdio). It listens for requests and invokes the ExtractMetadata method accordingly.
Analyzes a .NET assembly file (.dll) to extract its complete public API information.
Parameters:
dllPath(string, required): The absolute path to the target library's DLL file.
Returns:
A JSON string containing the detailed API definition.
Here is a JSON-RPC example of how to call the tool via the MCP protocol:
{
"jsonrpc": "2.0",
"method": "ExtractMetadata",
"params": {
"dllPath": "C:\\Path\\To\\Your\\Library.dll"
},
"id": 1
}Contributions to this project are welcome! If you have any ideas, suggestions, or have found a bug, please feel free to submit a Pull Request or create an Issue.
This project is licensed under the MIT License.