Filament MCP Server

Filament MCP Server

Enables AI assistants to build and manage Filament admin panels by providing component references, implementation plans, and official documentation lookups. It supports Laravel's Filament framework versions 4.x and 5.x through specialized tools and prompts.

Category
访问服务器

README

Filament MCP Server

A Model Context Protocol (MCP) server that provides tools, prompts, and resources for working with Filament - the Laravel admin panel framework.

Overview

This MCP server enables AI assistants to help developers build Filament admin panels by providing:

  • Component Reference: Access to Filament form, table, and infolist component documentation
  • Code Generation: Generate implementation plans for Filament resources
  • Documentation Lookup: Fetch and search official Filament documentation
  • Namespace Lookup: Get correct PHP namespaces for Filament classes
  • Command Reference: List available Filament artisan commands
  • Relationship Helpers: Laravel Eloquent relationship type references

Supports both Filament v4.x and v5.x.

Requirements

  • Node.js: v20.10.0 or higher
  • npm: v9.0.0 or higher (or pnpm v8.0.0+)

Installation

  1. Clone the repository:
cd filament-mcp-server
  1. Install dependencies:
npm install

Building

Compile TypeScript to JavaScript:

npm run build

This compiles the source from src/ to dist/. The main entry point is dist/index.js.

Running

Development Mode

Watch for changes and rebuild automatically:

npm run dev

Production Mode

Run the compiled server:

npm start

Stdio Mode

The server uses stdio transport by default. This allows it to communicate with MCP clients over standard input/output streams. The server starts and waits for JSON-RPC messages from the client.

MCP Integration

To use this server with MCP-compatible AI assistants, you need to register it as an MCP server. Below are configuration examples for popular clients.

Claude Desktop

Add the following to your Claude Desktop configuration file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

Windows: %APPDATA%/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "filament": {
      "command": "node",
      "args": ["/absolute/path/to/filament-mcp-server/dist/index.js"],
      "env": {}
    }
  }
}

or

(I prefer npx)

{
  "mcpServers": {
    "filament": {
      "command": "npx",
      "args": ["/absolute/path/to/filament-mcp-server"],
      "env": {}
    }
  }
}

Replace `/absolute/path/to/filament-mcp-server` with the actual path to this project.

### Cursor

1. Open Cursor settings
2. Navigate to **Features** → **MCP**
3. Add a new MCP server with the following configuration:

```json
{
  "mcpServers": {
    "filament": {
      "command": "node",
      "args": ["/absolute/path/to/filament-mcp-server/dist/index.js"]
    }
  }
}

Other MCP Clients

For other MCP-compatible assistants, configure them to spawn a child process using:

node /path/to/filament-mcp-server/dist/index.js

The server communicates via stdio using JSON-RPC 2.0 protocol.

Available Tools

The server provides the following MCP tools:

Tool Description
filament_get_component Get detailed information about a specific Filament component (properties, methods, examples)
filament_list_components List all components in a category (forms, tables, infolists, actions, schemas, support)
filament_get_namespace Get the correct PHP namespace for a Filament class type
filament_generate_plan Generate a complete Filament implementation plan for a resource
filament_get_commands Get a list of Filament artisan commands with descriptions
filament_get_relationships Get Laravel Eloquent relationship types with examples
filament_get_docs Fetch documentation from filamentphp.com for a specific category/section
filament_list_docs List all available documentation sections
filament_discover_docs Discover live documentation routes from the official website
filament_search_docs Search Filament documentation and return matching sections

Tool Parameters

  • version: All tools support a version parameter ("4.x" or "5.x") to target specific Filament versions. Defaults to "5.x".
  • component: Component name (e.g., TextInput, Select, Table)
  • category: Component category (forms, tables, infolists, actions, schemas, support)
  • classType: Filament class type (model, resource, widget, relation_manager, etc.)
  • description: What you want to build (used for plan generation)

Available Prompts

The server provides the following MCP prompts for common tasks:

Prompt Description
create_resource_plan Generate an implementation plan for a Filament resource
debug_filament_issue Help debug a Filament issue with error messages
create_relation_manager Generate a Filament RelationManager for relationships
create_custom_action Generate a custom Filament action
migrate_to_v5 Migrate Filament v4 code to v5
create_form_with_validation Generate a form with validation rules
create_table_with_features Generate a table with filters and actions

Available Resources

The server provides the following MCP resources:

Resource URI Description
filament://reference/v4/components Complete Filament v4 component reference
filament://reference/v5/components Complete Filament v5 component reference
filament://reference/v4/commands Filament v4 artisan commands
filament://reference/v5/commands Filament v5 artisan commands
filament://docs/v4/index Filament v4 documentation index
filament://docs/v5/index Filament v5 documentation index
filament://reference/quick Quick reference for common patterns

Configuration

Version Targeting

Most tools accept an optional version parameter to target Filament v4 or v5:

// Example tool call with version
{
  tool: "filament_get_component",
  arguments: {
    component: "TextInput",
    version: "5.x"  // or "4.x"
  }
}

Namespace Mapping

The server includes predefined namespace mappings for different Filament class types:

Class Type v4.x Namespace v5.x Namespace
model App\Models App\Models
resource App\Filament\Resources App\Filament\Resources
widget App\Filament\Widgets App\Filament\Widgets
relation_manager App\Filament\Resources\{Resource}\RelationManagers App\Filament\Resources\{Resource}\RelationManagers
form_component Filament\Forms\Components Filament\Forms\Components
schema_component (not available) Filament\Schemas\Components
table_column Filament\Tables\Columns Filament\Tables\Columns
action Filament\Actions Filament\Actions

Testing

Run tests with Vitest:

npm test

Run tests in watch mode:

npm run test:watch

Project Structure

filament-mcp-server/
├── src/
│   ├── index.ts              # Main entry point
│   ├── data/
│   │   └── filament-reference.ts  # Component reference data
│   ├── lib/
│   │   ├── doc-fetcher.ts    # Documentation fetching utilities
│   │   └── plan-generator.ts # Implementation plan generator
│   ├── prompts/
│   │   └── index.ts          # MCP prompts
│   ├── resources/
│   │   └── index.ts          # MCP resources
│   └── tools/
│       └── index.ts          # MCP tools
├── dist/                     # Compiled JavaScript output
├── tests/
│   └── index.test.ts         # Test suite
├── package.json
├── tsconfig.json
└── README.md

Dependencies

  • @modelcontextprotocol/sdk: MCP protocol implementation
  • cheerio: HTML parsing for documentation fetching
  • zod: Schema validation for tool parameters

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选