Skip to content
Back to skills

Mcp Development

ASecurity

Model Context Protocol (MCP) server development and AI/ML integration patterns. Covers MCP server implementation, tool design, resource handling, and LLM integration best practices. Use when developing MCP servers, creating AI tools, integrating with LLMs, or when asking about MCP protocol, prompt engineering, or AI system architecture.

  • 57 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added May 31, 2026
ai-agentstypescriptapisecuritydocumentation

Works with

  • cli
  • api
  • mcp

Security analysis

A100/100

Scanned May 31, 2026

npx -y skills add diegosouzapw/awesome-omni-skill --skill mcp-development --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Mcp Development?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Mcp Development
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/diegosouzapw-mcp-development/badge)](https://www.skillsdirectory.com/skills/diegosouzapw-mcp-development)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: mcp-development
description: Model Context Protocol (MCP) server development and AI/ML integration patterns. Covers MCP server implementation, tool design, resource handling, and LLM integration best practices. Use when developing MCP servers, creating AI tools, integrating with LLMs, or when asking about MCP protocol, prompt engineering, or AI system architecture.
---

# MCP Development

## What is MCP?

The Model Context Protocol (MCP) is an open protocol that enables AI assistants to interact with external tools, data sources, and services in a standardized way.

## Core Concepts

| Concept | Description |
|---------|-------------|
| **Tools** | Functions the AI can call |
| **Resources** | Data the AI can read |
| **Prompts** | Pre-defined prompt templates |
| **Transports** | Communication methods (stdio, HTTP) |

## MCP Server Structure

```typescript
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";

const server = new Server({
  name: "my-mcp-server",
  version: "1.0.0",
}, {
  capabilities: {
    tools: {},
    resources: {},
  }
});

// Define tools
server.setRequestHandler("tools/list", async () => ({
  tools: [
    {
      name: "get_data",
      description: "Fetch data from the API",
      inputSchema: {
        type: "object",
        properties: {
          id: { type: "string", description: "Item ID" }
        },
        required: ["id"]
      }
    }
  ]
}));

// Handle tool calls
server.setRequestHandler("tools/call", async (request) => {
  const { name, arguments: args } = request.params;
  
  if (name === "get_data") {
    const result = await fetchData(args.id);
    return { content: [{ type: "text", text: JSON.stringify(result) }] };
  }
  
  throw new Error(`Unknown tool: ${name}`);
});

// Start server
const transport = new StdioServerTransport();
await server.connect(transport);
```

## Tool Design Best Practices

### Clear Descriptions
```typescript
{
  name: "search_documents",
  description: "Search documents by keyword. Returns matching documents with relevance scores. Use when the user asks to find or search for specific content.",
  inputSchema: {
    type: "object",
    properties: {
      query: {
        type: "string",
        description: "Search query - can include multiple keywords"
      },
      limit: {
        type: "integer",
        description: "Maximum number of results (default: 10)",
        default: 10
      }
    },
    required: ["query"]
  }
}
```

### Error Handling
```typescript
server.setRequestHandler("tools/call", async (request) => {
  try {
    const result = await executeTool(request.params);
    return { content: [{ type: "text", text: result }] };
  } catch (error) {
    return {
      content: [{
        type: "text",
        text: `Error: ${error.message}`
      }],
      isError: true
    };
  }
});
```

## Resources

```typescript
server.setRequestHandler("resources/list", async () => ({
  resources: [
    {
      uri: "file:///docs/readme.md",
      name: "README",
      description: "Project documentation",
      mimeType: "text/markdown"
    }
  ]
}));

server.setRequestHandler("resources/read", async (request) => {
  const { uri } = request.params;
  const content = await readResource(uri);
  return {
    contents: [{
      uri,
      mimeType: "text/markdown",
      text: content
    }]
  };
});
```

## Transport Options

| Transport | Use Case |
|-----------|----------|
| stdio | Local CLI tools |
| HTTP/SSE | Web services, remote servers |

## Security Considerations

- [ ] Validate all input parameters
- [ ] Sanitize file paths
- [ ] Rate limit API calls
- [ ] Don't expose secrets
- [ ] Log all tool invocations
- [ ] Handle timeouts gracefully

## Detailed References

- **MCP Patterns**: See [references/mcp-patterns.md](references/mcp-patterns.md)
- **AI/ML Integration**: See [references/ai-ml-integration.md](references/ai-ml-integration.md)

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.