Skip to main content

Overview

The lua mcp command manages Model Context Protocol (MCP) servers. Use it to list, activate, deactivate, and delete MCP servers.
lua mcp              # Interactive mode
lua mcp list         # List all servers
lua mcp activate     # Activate a server
lua mcp deactivate   # Deactivate a server
lua mcp delete       # Delete a server

Commands

lua mcp

Interactive MCP server management.
lua mcp
Opens an interactive menu to:
  • List MCP servers
  • Activate a server
  • Deactivate a server
  • Delete a server

lua mcp list

List all MCP servers and their status.
lua mcp list
# or
lua mcp ls
Output:
============================================================
🔌 MCP Servers
============================================================

✅ Active Servers:

🟢 filesystem
   Transport: stdio
   Command: npx -y @modelcontextprotocol/server-filesystem /data
   ID: mcp_abc123

────────────────────────────────────────

⏸️  Inactive Servers:

⚪ github
   Transport: stdio
   Command: npx -y @modelcontextprotocol/server-github
   ID: mcp_def456

============================================================

lua mcp activate

Activate an MCP server to make its tools available.
lua mcp activate              # Interactive selection
lua mcp activate github       # Activate by name
# or
lua mcp enable github         # Alias
What happens:
  • Server is marked as active
  • Server’s tools become available to your agent
  • Tools appear in the agent’s tool list at runtime
Example:
$ lua mcp activate github
🔄 Activating github...

 MCP server "github" activated successfully!

💡 The server's tools are now available to your agent.

lua mcp deactivate

Deactivate an MCP server to remove its tools.
lua mcp deactivate              # Interactive selection
lua mcp deactivate github       # Deactivate by name
# or
lua mcp disable github          # Alias
What happens:
  • Server is marked as inactive
  • Server’s tools are removed from agent runtime
  • Configuration is preserved (can be re-activated)
Example:
$ lua mcp deactivate github
🔄 Deactivating github...

 MCP server "github" deactivated successfully!

💡 The server's tools are no longer available to your agent.

lua mcp delete

Permanently delete an MCP server.
lua mcp delete              # Interactive selection
lua mcp delete github       # Delete by name
# or
lua mcp rm github           # Alias
This is permanent! Deleting an MCP server removes it from the platform. You’ll need to re-compile and push to recreate it.
Example:
$ lua mcp delete github

⚠️  You are about to delete MCP server: github
⚠️  WARNING: This server is currently ACTIVE!
? Are you sure you want to delete this MCP server? (y/N) y

🔄 Deleting github...

 MCP server "github" deleted successfully!

Command Aliases

CommandAlias
lua mcp listlua mcp ls
lua mcp activatelua mcp enable
lua mcp deactivatelua mcp disable
lua mcp deletelua mcp rm

Pushing MCP Servers

MCP servers can also be pushed using the lua push command:
# Push a single MCP server
lua push mcp
# Select server from list

# Push all components including MCP servers
lua push all --force
When pushing all with --auto-deploy, MCP servers are automatically activated:
lua push all --force --auto-deploy

Workflow Example

1

Define MCP Server

Create the server in your code:
// src/mcp/github.ts
import { LuaMCPServer } from 'lua-cli';

export const githubServer = new LuaMCPServer({
  name: 'github',
  transport: 'stdio',
  command: 'npx',
  args: ['-y', '@modelcontextprotocol/server-github'],
  env: { 'GITHUB_TOKEN': process.env.GITHUB_TOKEN }
});
2

Add to Agent

// src/index.ts
import { LuaAgent } from 'lua-cli';
import { githubServer } from './mcp/github';

export const agent = new LuaAgent({
  name: 'my-agent',
  persona: '...',
  mcpServers: [githubServer]
});
3

Compile

lua compile
# Server is registered, ID assigned
4

Push

lua push mcp
# or
lua push all --force
5

Activate

lua mcp activate github
# Tools are now available
6

Verify

lua mcp list
# Shows github as active

Tips

Use lua mcp list to see current status before making changes
lua mcp list
# Shows which servers are active/inactive
Keep unused servers deactivated to reduce overhead
lua mcp activate github    # When needed
lua mcp deactivate github  # When done
In CI/CD, use lua push all --force to avoid prompts
lua push all --force --auto-deploy

See Also