nuxt-mcp
TypeScript icon, indicating that this package has built-in type declarations

0.1.2 • Public • Published

nuxt-mcp

npm version npm downloads bundle JSDocs License

MCP server helping models to understand your Nuxt app better.

[!IMPORTANT] Experimental. Use with caution.

// nuxt.config.ts

export default defineNuxtConfig({
  modules: ['nuxt-mcp'],
})

Then the MCP server will be available at http://localhost:3000/__mcp/sse.

  • If you are using VSCode, create a .vscode/mcp.json file in your project root, this plugin will automatically update it for you.
  • If you are using Cursor, create a .cursor/mcp.json file in your project root, this plugin will automatically update it for you.

Module Hooks

For other modules to provide additional information to MCP, you can use the mcp:setup hook.

// src/module.ts

export default defineNuxtModule({
  meta: {
    name: 'my-module',
  },
  async setup(options, nuxt) {
    nuxt.hook('mcp:setup', ({ mcp }) => {
      // Setup your MCP tools here
      // For example
      mcp.tool('get-nuxt-root', 'Get the Nuxt root path', {}, async () => {
        return {
          content: [{
            type: 'text',
            text: nuxt.options.rootDir,
          }],
        }
      })
    })
  },
})

Sponsors

License

MIT License © Anthony Fu

Package Sidebar

Install

npm i nuxt-mcp

Weekly Downloads

613

Version

0.1.2

License

MIT

Unpacked Size

17.1 kB

Total Files

7

Last publish

Collaborators

  • antfu