@minjunkwon/localgovernment-welfare-mcp-server
Version:
MCP server for Korean Local Government Welfare Services - provides intelligent search and information retrieval for local government social welfare programs
856 lines (785 loc) โข 27.4 kB
JavaScript
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
import { ListToolsRequestSchema } from "@modelcontextprotocol/sdk/types.js";
const server = new Server({
name: "localgovernment-welfare-mcp-server",
version: "1.0.0"
}, {
capabilities: {
tools: {},
},
});
server.setRequestHandler(ListToolsRequestSchema, async () => {
return {
tools: [
{
name: "search_local_welfare_services",
description: `Search local government welfare services in Korea with structured filtering options.
WHEN TO USE: When user asks for specific welfare services with clear criteria (region, target group, topic, etc.)
PARAMETER INFERENCE GUIDE:
๐ข Region (ctpvNm/sggNm):
- User says "์์ธ ์ํ๊ตฌ" โ ctpvNm: "์์ธํน๋ณ์", sggNm: "์ํ๊ตฌ"
- User says "๊ฒฝ๊ธฐ๋ ์ฑ๋จ์" โ ctpvNm: "๊ฒฝ๊ธฐ๋", sggNm: "์ฑ๋จ์"
- User says "๋ถ์ฐ" โ ctpvNm: "๋ถ์ฐ๊ด์ญ์"
๐ฅ Target Group (trgterIndvdlArray):
- "์ ์๋์ธต", "๊ธฐ์ด์ํ์๊ธ์" โ "050"
- "์ฅ์ ์ธ" โ "040"
- "ํ๋ถ๋ชจ๊ฐ์ ", "์กฐ์๊ฐ์ " โ "060"
- "๋ค์๋
๊ฐ์ " โ "020"
- "๋ณดํ๋์์" โ "030"
๐ฏ Life Stage (lifeArray):
- "์์ ", "์ถ์ฐ", "์ฐ๋ชจ" โ "007"
- "์์ ์", "์ ์์" โ "001"
- "์๋", "์ด๋ฆฐ์ด" โ "002"
- "์ฒญ์๋
" โ "003"
- "์ฒญ๋
", "๋ํ์" โ "004"
- "์ค์ฅ๋
" โ "005"
- "๋
ธ์ธ", "์ด๋ฅด์ " โ "006"
๐ Interest Theme (intrsThemaArray):
- "์ผ์๋ฆฌ", "์ทจ์
", "๊ณ ์ฉ" โ "050"
- "์ฃผ๊ฑฐ", "์ฃผํ" โ "040"
- "๋ณด์ก", "์ด๋ฆฐ์ด์ง" โ "090"
- "๊ต์ก" โ "100"
- "์๋ฃ", "๊ฑด๊ฐ" โ "010"
- "์๋ฏผ๊ธ์ต", "์ง์๊ธ" โ "130"
๐ Search Parameters:
- srchKeyCode: "001" for service name, "002" for organization, "003" for region
- searchWrd: keyword to search for
- age: specific age number for filtering
EXAMPLES:
1. "์์ธ ์ํ๊ตฌ ์ ์๋์ธต ๋ณต์ง์๋น์ค" โ {"ctpvNm": "์์ธํน๋ณ์", "sggNm": "์ํ๊ตฌ", "trgterIndvdlArray": "050"}
2. "๋ถ์ฐ ์ฒญ๋
์ผ์๋ฆฌ ์ง์" โ {"ctpvNm": "๋ถ์ฐ๊ด์ญ์", "lifeArray": "004", "intrsThemaArray": "050"}
3. "๊ฒฝ๊ธฐ๋ ์ฅ์ ์ธ ์ฃผ๊ฑฐ ์๋น์ค" โ {"ctpvNm": "๊ฒฝ๊ธฐ๋", "trgterIndvdlArray": "040", "intrsThemaArray": "040"}
4. "์์ ์ง์ ๊ฒ์" โ {"srchKeyCode": "001", "searchWrd": "์์ "}
5. "30์ธ ์ฒญ๋
์ง์" โ {"age": 30, "lifeArray": "004"}`,
inputSchema: {
type: "object",
properties: {
serviceKey: {
type: "string",
description: "์๋น์คํค (์ ํ์ฌํญ)"
},
pageNo: {
type: "integer",
minimum: 1,
maximum: 1000,
description: "ํ์ด์ง ๋ฒํธ (๊ธฐ๋ณธ๊ฐ: 1)"
},
numOfRows: {
type: "integer",
minimum: 1,
maximum: 100,
description: "์ถ๋ ฅ ๊ฑด์ (๊ธฐ๋ณธ๊ฐ: 10)"
},
lifeArray: {
type: "string",
enum: ["001", "002", "003", "004", "005", "006", "007"],
description: "์์ ์ฃผ๊ธฐ๋ณ ํํฐ๋ง (001: ์์ ์, 002: ์๋, 003: ์ฒญ์๋
, 004: ์ฒญ๋
, 005: ์ค์ฅ๋
, 006: ๋
ธ๋
, 007: ์์ ยท์ถ์ฐ)"
},
trgterIndvdlArray: {
type: "string",
enum: ["010", "020", "030", "040", "050", "060"],
description: "๊ฐ๊ตฌ์ํฉ๋ณ ํํฐ๋ง (010: ๋ค๋ฌธํยทํ๋ถ๋ฏผ, 020: ๋ค์๋
, 030: ๋ณดํ๋์์, 040: ์ฅ์ ์ธ, 050: ์ ์๋, 060: ํ๋ถ๋ชจยท์กฐ์)"
},
intrsThemaArray: {
type: "string",
enum: ["010", "020", "030", "040", "050", "060", "070", "080", "090", "100", "110", "120", "130", "140"],
description: "๊ด์ฌ์ฃผ์ ๋ณ ํํฐ๋ง (010: ์ ์ฒด๊ฑด๊ฐ, 020: ์ ์ ๊ฑด๊ฐ, 030: ์ํ์ง์, 040: ์ฃผ๊ฑฐ, 050: ์ผ์๋ฆฌ, 060: ๋ฌธํยท์ฌ๊ฐ, 070: ์์ ยท์๊ธฐ, 080: ์์ ยท์ถ์ฐ, 090: ๋ณด์ก, 100: ๊ต์ก, 110: ์
์ยท์ํ, 120: ๋ณดํธยท๋๋ด, 130: ์๋ฏผ๊ธ์ต, 140: ๋ฒ๋ฅ )"
},
age: {
type: "integer",
minimum: 0,
maximum: 150,
description: "์ฐ๋ น (์ ํ์ฌํญ)"
},
ctpvNm: {
type: "string",
description: "์๋๋ช
(์: '์์ธํน๋ณ์', '๊ฒฝ๊ธฐ๋', '๋ถ์ฐ๊ด์ญ์' ๋ฑ)"
},
sggNm: {
type: "string",
description: "์๊ตฐ๊ตฌ๋ช
(์: '์ํ๊ตฌ', '์ฑ๋จ์', '๋ถ์ฐ์ง๊ตฌ' ๋ฑ)"
},
srchKeyCode: {
type: "string",
enum: ["001", "002", "003"],
description: "๊ฒ์ํค์ฝ๋ (001: ์๋น์ค๋ช
, 002: ๊ธฐ๊ด๋ช
, 003: ์ง์ญ๋ช
)"
},
searchWrd: {
type: "string",
description: "๊ฒ์์ด (์ ํ์ฌํญ)"
},
arrgOrd: {
type: "string",
enum: ["001", "002"],
description: "์ ๋ ฌ์์ (001: ์ต์ ์, 002: ์ธ๊ธฐ์)"
}
}
}
},
{
name: "get_local_welfare_codes",
description: `Get code definitions used in the local welfare services API.
WHEN TO USE: When you need to understand what codes mean or show users available options.
PARAMETER:
codeType (OPTIONAL): Type of codes to retrieve
- "all" (default): All code types
- "lifeCycle": Life stage codes (์์ ์, ์๋, ์ฒญ์๋
, etc.)
- "householdType": Household situation codes (์ ์๋, ์ฅ์ ์ธ, ํ๋ถ๋ชจ, etc.)
- "interestTheme": Interest theme codes (์ผ์๋ฆฌ, ์ฃผ๊ฑฐ, ๊ต์ก, etc.)
- "sortOrder": Sort order options (์ต์ ์, ์ธ๊ธฐ์)
USAGE: Call this when user asks about available options or code meanings.`,
inputSchema: {
type: "object",
properties: {
codeType: {
type: "string",
enum: ["lifeCycle", "householdType", "interestTheme", "sortOrder", "all"],
description: "Type of codes to retrieve (default: all)"
}
}
}
},
WHEN, TO, USE, When, you, want, to, search
], for: services, and, immediately, get their() { }, detailed, information, without, multiple, API, calls, : .
PARAMETERS, Same, as, search_local_welfare_services, plus: -includeDetails(boolean), Whether, to, fetch, detailed, information, for: each
}
- maxDetails(number);
Maximum;
number;
of;
services;
to;
get;
details;
for (; ; )
;
10, max;
20;
});
USAGE: This;
combines;
search;
and;
batch;
detail;
fetching;
to;
provide;
complete;
information;
efficiently. `,
inputSchema: {
type: "object",
properties: {
pageNo: {
type: "number",
description: "Page number (default: 1)"
},
numOfRows: {
type: "number",
description: "Number of results per page (default: 10, max: 100)"
},
ctpvNm: {
type: "string",
description: "Province/City name (e.g., '์์ธํน๋ณ์')"
},
sggNm: {
type: "string",
description: "District name (e.g., '์ํ๊ตฌ')"
},
lifeArray: {
type: "string",
description: "Life stage code (001-007)"
},
trgterIndvdlArray: {
type: "string",
description: "Target individual code (001-010)"
},
intrsThemaArray: {
type: "string",
description: "Interest theme code (001-012)"
},
age: {
type: "number",
description: "Age"
},
searchWrd: {
type: "string",
description: "Search keyword"
},
includeDetails: {
type: "boolean",
description: "Whether to fetch detailed information (default: false)"
},
maxDetails: {
type: "number",
description: "Maximum number of services to get details for (default: 10, max: 20)"
}
}
}
},
{
name: "get_local_welfare_codes",
description: `;
Get;
code;
definitions;
used in the;
local;
welfare;
services;
API.
;
WHEN;
TO;
USE: When;
you;
need;
to;
understand;
what;
codes;
mean;
or;
show;
users;
available;
options.
PARAMETER;
codeType(OPTIONAL);
Type;
of;
codes;
to;
retrieve
- "all"();
All;
code;
types
- "lifeCycle";
Life;
stage;
codes(์์ ์, ์๋, ์ฒญ์๋
, etc.)
- "householdType";
Household;
situation;
codes(์ ์๋, ์ฅ์ ์ธ, ํ๋ถ๋ชจ, etc.)
- "interestTheme";
Interest;
theme;
codes(์ผ์๋ฆฌ, ์ฃผ๊ฑฐ, ๊ต์ก, etc.)
- "sortOrder";
Sort;
order;
options(์ต์ ์, ์ธ๊ธฐ์);
USAGE: Call;
this;
when;
user;
asks;
about;
available;
options;
or;
code;
meanings. `,
inputSchema: {
type: "object",
properties: {
codeType: {
type: "string",
enum: ["lifeCycle", "householdType", "interestTheme", "sortOrder", "all"],
description: "Type of codes to retrieve (default: all)"
}
}
}
}
],
};
});
server.setRequestHandler(CallToolRequestSchema, async (request) => {
try {
console.error('CallToolRequest received:', JSON.stringify(request));
const { name, arguments: args } = request.params;
// arguments๊ฐ ์๋ ๊ฒฝ์ฐ ๋ ์์ธํ ๋ก๊น
if (!args) {
console.error('No arguments provided in request.params:', request.params);
throw new McpError(ErrorCode.InvalidParams, "No arguments provided");
}
switch (name) {
case "search_local_welfare_services": {
console.error('search_local_welfare_services called with args:', JSON.stringify(args));
if (!args || typeof args !== 'object') {
throw new McpError(ErrorCode.InvalidParams, "Invalid arguments provided");
}
const searchParams: LocalWelfareListRequest = {
pageNo: args && 'pageNo' in args ? Number(args.pageNo) || 1 : 1,
numOfRows: args && 'numOfRows' in args ? Number(args.numOfRows) || 10 : 10
};
// ๋ชจ๋ ๋งค๊ฐ๋ณ์ ์ฒ๋ฆฌ
if (args && 'serviceKey' in args && typeof args.serviceKey === 'string' && args.serviceKey.trim()) {
searchParams.serviceKey = args.serviceKey;
}
if ((args as any).lifeArray && (args as any).lifeArray.trim()) {
searchParams.lifeArray = (args as any).lifeArray;
}
if ((args as any).trgterIndvdlArray && (args as any).trgterIndvdlArray.trim()) {
searchParams.trgterIndvdlArray = (args as any).trgterIndvdlArray;
}
if ((args as any).intrsThemaArray && (args as any).intrsThemaArray.trim()) {
searchParams.intrsThemaArray = (args as any).intrsThemaArray;
}
if ((args as any).age !== undefined && (args as any).age !== null) {
searchParams.age = (args as any).age;
}
if ((args as any).ctpvNm && (args as any).ctpvNm.trim()) {
searchParams.ctpvNm = (args as any).ctpvNm;
}
if ((args as any).sggNm && (args as any).sggNm.trim()) {
searchParams.sggNm = (args as any).sggNm;
}
if ((args as any).srchKeyCode && ['001', '002', '003'].includes((args as any).srchKeyCode)) {
searchParams.srchKeyCode = (args as any).srchKeyCode;
}
if ((args as any).searchWrd && (args as any).searchWrd.trim()) {
searchParams.searchWrd = (args as any).searchWrd;
}
if ((args as any).arrgOrd && ['001', '002'].includes((args as any).arrgOrd)) {
searchParams.arrgOrd = (args as any).arrgOrd;
}
// ์์ธ์กฐํ ์ต์
(ํญ์ ํ์ฑํ)
const maxDetails = args && 'maxDetails' in args ? Math.min(Number(args.maxDetails) || 15, 20) : 15;
try {
// 1๋จ๊ณ: ๋ชฉ๋ก ์กฐํ
const localWelfareAPI = new LocalWelfareAPI();
const searchResult = await localWelfareAPI.getLocalWelfareList(searchParams);
// 2๋จ๊ณ: ์๋ ์์ธ์กฐํ
const servList = (searchResult as any).wantedList?.servList;
if (!servList || servList.length === 0) {
return {
content: [
{
type: "text",
text: JSON.stringify({
searchParams: searchParams,
searchResult: searchResult,
details: [],
message: "No services found"
}, null, 2)
}
]
};
}
// ์์ธ์กฐํํ ์๋น์ค ID ๋ชฉ๋ก ์์ฑ (์ต๋ maxDetails๊ฐ)
const servIds = (Array.isArray(servList) ? servList : [servList])
.slice(0, maxDetails)
.map(service => service.servId)
.filter(id => id);
console.error(`;
Auto - fetching;
details;
for ($; { servIds, : .length }; services)
;
`);
const detailResults: any[] = [];
for (let i = 0; i < servIds.length; i++) {
const servId = servIds[i];
try {
console.error(`;
Fetching;
details;
for ($; { servId }($, { i } + 1, /${servIds.length}) `);
const detailAPI = new LocalWelfareAPI();
const detailResult = await detailAPI.getLocalWelfareDetail({ servId });
detailResults.push({
servId,
success: true,
data: detailResult.wantedDtl
});
// API ํธ์ถ ๊ฐ 500ms ์ง์ฐ (๋ง์ง๋ง ํธ์ถ ์ ์ธ)
if (i < servIds.length - 1) {
await new Promise(resolve => setTimeout(resolve, 500));
}
} catch (error) {
console.error(`; Error)
fetching;
details;
for ($; { servId }; )
: `, error);
detailResults.push({
servId,
success: false,
error: error instanceof Error ? error.message : String(error)
});
}
}
return {
content: [
{
type: "text",
text: JSON.stringify({
searchParams: searchParams,
searchResult: searchResult,
detailsSummary: {
total: servIds.length,
successful: detailResults.filter(r => r.success).length,
failed: detailResults.filter(r => !r.success).length
},
details: detailResults
}, null, 2)
}
]
};
} catch (error) {
console.error('Error in search_local_welfare_services:', error);
throw new McpError(
ErrorCode.InternalError,
`;
Failed;
to;
search;
welfare;
services;
with (details)
: $;
{
error instanceof Error ? error.message : String(error);
}
`
);
}
}
case "get_local_welfare_detail": {
console.error('get_local_welfare_detail called with args:', JSON.stringify(args));
if (!args || typeof args !== 'object') {
throw new McpError(ErrorCode.InvalidParams, "Invalid arguments provided");
}
const servId = args && 'servId' in args ? String(args.servId) : null;
if (!servId) {
throw new McpError(ErrorCode.InvalidParams, "servId is required");
}
const detailParams: LocalWelfareDetailRequest = {
servId: servId
};
try {
const localWelfareAPI = new LocalWelfareAPI();
const result = await localWelfareAPI.getLocalWelfareDetail(detailParams);
return {
content: [
{
type: "text",
text: JSON.stringify(result, null, 2)
}
]
};
} catch (error) {
console.error('Error in get_local_welfare_detail:', error);
throw new McpError(
ErrorCode.InternalError,
`;
Failed;
to;
get;
welfare;
detail: $;
{
error instanceof Error ? error.message : String(error);
}
`
);
}
}
case "get_multiple_welfare_details": {
console.error('get_multiple_welfare_details called with args:', JSON.stringify(args));
if (!args || typeof args !== 'object') {
throw new McpError(ErrorCode.InvalidParams, "Invalid arguments provided");
}
const servIdsString = args && 'servIds' in args ? String(args.servIds) : '';
if (!servIdsString) {
throw new McpError(ErrorCode.InvalidParams, "servIds is required");
}
const servIds = servIdsString.split(',').map(id => id.trim()).filter(id => id);
if (servIds.length === 0) {
throw new McpError(ErrorCode.InvalidParams, "At least one valid service ID is required");
}
const results: any[] = [];
const errors: string[] = [];
for (let i = 0; i < servIds.length; i++) {
const servId = servIds[i];
try {
console.error(`;
Fetching;
details;
for ($; { servId }($, { i } + 1, /${servIds.length}) `);
const localWelfareAPI = new LocalWelfareAPI();
const result = await localWelfareAPI.getLocalWelfareDetail({ servId });
results.push({
servId,
success: true,
data: result.wantedDtl
});
// API ํธ์ถ ๊ฐ 500ms ์ง์ฐ (๋ง์ง๋ง ํธ์ถ ์ ์ธ)
if (i < servIds.length - 1) {
await new Promise(resolve => setTimeout(resolve, 500));
}
} catch (error) {
console.error(`; Error)
fetching;
$;
{
servId;
}
`, error);
errors.push(`;
$;
{
servId;
}
$;
{
error instanceof Error ? error.message : String(error);
}
`);
results.push({
servId,
success: false,
error: error instanceof Error ? error.message : String(error)
});
}
}
const summary = {
total: servIds.length,
successful: results.filter(r => r.success).length,
failed: results.filter(r => !r.success).length,
results: results
};
return {
content: [
{
type: "text",
text: JSON.stringify(summary, null, 2)
}
]
};
}
case "search_welfare_with_details": {
console.error('search_welfare_with_details called with args:', JSON.stringify(args));
if (!args || typeof args !== 'object') {
throw new McpError(ErrorCode.InvalidParams, "Invalid arguments provided");
}
// ๊ฒ์ ํ๋ผ๋ฏธํฐ ๊ตฌ์ฑ
const searchParams: LocalWelfareListRequest = {
pageNo: args && 'pageNo' in args ? Number(args.pageNo) || 1 : 1,
numOfRows: args && 'numOfRows' in args ? Number(args.numOfRows) || 10 : 10
};
// ๋ชจ๋ ๊ฒ์ ๋งค๊ฐ๋ณ์ ์ฒ๋ฆฌ (๊ธฐ์กด search_local_welfare_services์ ๋์ผ)
if (args && 'ctpvNm' in args && typeof args.ctpvNm === 'string' && args.ctpvNm.trim()) {
searchParams.ctpvNm = args.ctpvNm;
}
if (args && 'sggNm' in args && typeof args.sggNm === 'string' && args.sggNm.trim()) {
searchParams.sggNm = args.sggNm;
}
if (args && 'lifeArray' in args && typeof args.lifeArray === 'string' && args.lifeArray.trim()) {
searchParams.lifeArray = args.lifeArray as any;
}
if (args && 'trgterIndvdlArray' in args && typeof args.trgterIndvdlArray === 'string' && args.trgterIndvdlArray.trim()) {
searchParams.trgterIndvdlArray = args.trgterIndvdlArray as any;
}
if (args && 'intrsThemaArray' in args && typeof args.intrsThemaArray === 'string' && args.intrsThemaArray.trim()) {
searchParams.intrsThemaArray = args.intrsThemaArray as any;
}
if (args && 'age' in args && typeof args.age === 'number') {
searchParams.age = args.age;
}
if (args && 'searchWrd' in args && typeof args.searchWrd === 'string' && args.searchWrd.trim()) {
searchParams.searchWrd = args.searchWrd;
}
// ์์ธ์กฐํ ์ต์
const includeDetails = args && 'includeDetails' in args ? Boolean(args.includeDetails) : false;
const maxDetails = args && 'maxDetails' in args ? Math.min(Number(args.maxDetails) || 10, 20) : 10;
try {
// 1๋จ๊ณ: ๋ชฉ๋ก ์กฐํ
const localWelfareAPI = new LocalWelfareAPI();
const searchResult = await localWelfareAPI.getLocalWelfareList(searchParams);
if (!includeDetails) {
// ์์ธ์กฐํ ์์ด ๋ชฉ๋ก๋ง ๋ฐํ
return {
content: [
{
type: "text",
text: JSON.stringify({
searchParams: searchParams,
result: searchResult
}, null, 2)
}
]
};
}
// 2๋จ๊ณ: ์์ธ์กฐํ ์ํ
const servList = (searchResult as any).wantedList?.servList;
if (!servList || servList.length === 0) {
return {
content: [
{
type: "text",
text: JSON.stringify({
searchParams: searchParams,
searchResult: searchResult,
details: [],
message: "No services found to get details for"
}, null, 2)
}
]
};
}
// ์์ธ์กฐํํ ์๋น์ค ID ๋ชฉ๋ก ์์ฑ (์ต๋ maxDetails๊ฐ)
const servIds = (Array.isArray(servList) ? servList : [servList])
.slice(0, maxDetails)
.map(service => service.servId)
.filter(id => id);
console.error(`;
Fetching;
details;
for ($; { servIds, : .length }; services)
;
`);
const detailResults: any[] = [];
for (let i = 0; i < servIds.length; i++) {
const servId = servIds[i];
try {
console.error(`;
Fetching;
details;
for ($; { servId }($, { i } + 1, /${servIds.length}) `);
const detailAPI = new LocalWelfareAPI();
const detailResult = await detailAPI.getLocalWelfareDetail({ servId });
detailResults.push({
servId,
success: true,
data: detailResult.wantedDtl
});
// API ํธ์ถ ๊ฐ 500ms ์ง์ฐ (๋ง์ง๋ง ํธ์ถ ์ ์ธ)
if (i < servIds.length - 1) {
await new Promise(resolve => setTimeout(resolve, 500));
}
} catch (error) {
console.error(`; Error)
fetching;
details;
for ($; { servId }; )
: `, error);
detailResults.push({
servId,
success: false,
error: error instanceof Error ? error.message : String(error)
});
}
}
return {
content: [
{
type: "text",
text: JSON.stringify({
searchParams: searchParams,
searchResult: searchResult,
detailsSummary: {
total: servIds.length,
successful: detailResults.filter(r => r.success).length,
failed: detailResults.filter(r => !r.success).length
},
details: detailResults
}, null, 2)
}
]
};
} catch (error) {
console.error('Error in search_welfare_with_details:', error);
throw new McpError(
ErrorCode.InternalError,
`;
Failed;
to;
search;
welfare;
services;
with (details)
: $;
{
error instanceof Error ? error.message : String(error);
}
`
);
}
}
case "get_local_welfare_codes": {
const codeType = (args as any).codeType || "all";
let codes: any = {};
switch (codeType) {
case "lifeCycle":
codes = { lifeCycle: LifeCycleCode };
break;
case "householdType":
codes = { householdType: HouseholdTypeCode };
break;
case "interestTheme":
codes = { interestTheme: InterestThemeCode };
break;
case "sortOrder":
codes = { sortOrder: SortOrderCode };
break;
case "all":
default:
codes = {
lifeCycle: LifeCycleCode,
householdType: HouseholdTypeCode,
interestTheme: InterestThemeCode,
sortOrder: SortOrderCode
};
break;
}
return {
content: [
{
type: "text",
text: JSON.stringify(codes, null, 2)
}
]
};
}
default:
throw new McpError(ErrorCode.MethodNotFound, `;
Unknown;
tool: $;
{
name;
}
`);
}
} catch (error) {
if (error instanceof McpError) {
throw error;
}
throw new McpError(
ErrorCode.InternalError,
`;
Tool;
execution;
failed: $;
{
error instanceof Error ? error.message : String(error);
}
`
);
}
});
async function main() {
const transport = new StdioServerTransport();
await server.connect(transport);
console.error("Local Government Welfare MCP Server running on stdio");
}
main().catch((error) => {
console.error("Server failed to start:", error);
process.exit(1);
});;
//# sourceMappingURL=index-old.js.map