What are MCP Servers?
MCP Servers are external processes that provide additional tools to your agent using the Model Context Protocol (MCP). Instead of building every tool from scratch, you can connect to existing MCP servers that provide file access, database queries, web searches, and more.Think of it as:
Plug-and-play extensions for your agent - connect to pre-built tools without writing code
What is MCP? The Model Context Protocol is an open standard developed by Anthropic for connecting AI models to external tools and data sources. Learn more at modelcontextprotocol.io.
Why MCP Servers?
No Code Required
Use existing MCP servers - just configure and connect
Open Standard
MCP is an open protocol with a growing ecosystem
Extend Capabilities
Add file access, databases, web search, and more
Mix & Match
Combine MCP servers with your custom LuaSkills
How MCP Servers Work
1
Configure Server
Define the MCP server in your code with transport and connection details
2
Compile & Push
Run
lua compile and lua push mcp to register with the platform3
Activate
Activate the server to make its tools available to your agent
4
Agent Uses Tools
Your agent automatically discovers and uses the MCP server’s tools
Transport Types
MCP servers can run locally or remotely:- stdio (Local)
- sse (Remote)
Run locally as a process
- Uses stdin/stdout for communication
- Great for npm packages and CLI tools
- No network overhead
Simple Example
Common Use Cases
- File Access
- Web Search
- GitHub
- Databases
Read and write filesTools provided:
read_file- Read file contentswrite_file- Write to fileslist_directory- List filessearch_files- Search by pattern
MCP vs Custom Skills
| Aspect | MCP Servers | LuaSkill |
|---|---|---|
| Code Required | None (just config) | Yes (TypeScript) |
| Customization | Limited to server options | Full control |
| Availability | Growing ecosystem | Unlimited |
| Best For | Standard integrations | Custom business logic |
Best practice: Use MCP servers for standard integrations (files, search, databases) and LuaSkill for custom business logic. They work great together!
Lifecycle
MCP servers have a simple lifecycle:1. Define
1. Define
Create
LuaMCPServer in your source code2. Compile
2. Compile
Run
lua compile - registers server and gets ID3. Push
3. Push
Run
lua push mcp or lua push all --force - syncs configuration4. Activate
4. Activate
Run
lua mcp activate - makes tools available to agent5. Use
5. Use
Agent discovers and uses MCP server tools at runtime
6. Deactivate
6. Deactivate
Run
lua mcp deactivate - removes tools from agentManaging MCP Servers
Use thelua mcp command to manage servers:

