Skip to main content
Glama
mjpitz

RFC MCP Server

by mjpitz

get_rfc_section

Extract specific sections from IETF RFC documents by providing the RFC number and section identifier, enabling targeted access to technical specifications and protocols.

Instructions

Get a specific section from an RFC

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
numberYesRFC number (e.g. "2616")
sectionYesSection title or number to retrieve

Implementation Reference

  • The handler for the 'get_rfc_section' tool. Validates parameters, fetches the RFC using rfcService, finds the section by case-insensitive title match, and returns the JSON stringified section or appropriate error.
    case 'get_rfc_section': {
      if (typeof typedArgs.number !== 'string' || typeof typedArgs.section !== 'string') {
        throw new McpError(
          ErrorCode.InvalidParams,
          'RFC number and section must be strings'
        );
      }
      
      try {
        const rfc = await rfcService.fetchRfc(typedArgs.number);
        
        // Find the matching section
        const sectionQuery = typedArgs.section.toLowerCase();
        const section = rfc.sections.find(s => 
          s.title.toLowerCase().includes(sectionQuery) || 
          s.title.toLowerCase() === sectionQuery
        );
        
        if (!section) {
          return {
            content: [
              {
                type: 'text',
                text: `Section "${typedArgs.section}" not found in RFC ${typedArgs.number}`,
              },
            ],
            isError: true,
          };
        }
        
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(section, null, 2),
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: 'text',
                text: `Error fetching section from RFC ${typedArgs.number}: ${error}`,
            },
          ],
          isError: true,
        };
      }
    }
  • src/index.ts:168-185 (registration)
    Registration of the 'get_rfc_section' tool in the MCP server tools list, including name, description, and input schema definition.
      name: 'get_rfc_section',
      description: 'Get a specific section from an RFC',
      inputSchema: {
        type: 'object',
        properties: {
          number: {
            type: 'string',
            description: 'RFC number (e.g. "2616")',
          },
          section: {
            type: 'string',
            description: 'Section title or number to retrieve',
          },
        },
        required: ['number', 'section'],
        additionalProperties: false,
      },
    },
  • Input schema validation for the 'get_rfc_section' tool parameters.
    inputSchema: {
      type: 'object',
      properties: {
        number: {
          type: 'string',
          description: 'RFC number (e.g. "2616")',
        },
        section: {
          type: 'string',
          description: 'Section title or number to retrieve',
        },
      },
      required: ['number', 'section'],
      additionalProperties: false,
    },
Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mjpitz/mcp-rfc'

If you have feedback or need assistance with the MCP directory API, please join our Discord server