mcp-format
v0.1.0
Published
Formats code using Prettier. Takes source code and language, returns formatted output. Supports JavaScript, TypeScript, CSS, HTML, JSON, Markdown, YAML, and GraphQL.
Maintainers
Readme
mcp-format
An MCP server that formats code using Prettier. Pass in source code and a language, get back cleanly formatted output.
Supported languages
JavaScript, TypeScript, CSS, HTML, JSON, Markdown, YAML, GraphQL
Quick start
npx mcp-formatConfiguration
Add to your .mcp.json:
{
"mcpServers": {
"format": {
"command": "npx",
"args": ["-y", "mcp-format"]
}
}
}Tool
format
Parameters:
| Name | Type | Description |
|------|------|-------------|
| code | string | The source code to format |
| language | string | Language identifier: js, ts, css, html, json, md, yaml, graphql |
Example:
{
"code": "const x={a:1,b:2,c:3}",
"language": "js"
}Returns the formatted code as text.
License
MIT
