MCP 작동원리
[SYSTEM] Starting MCP client...[SYSTEM] Available tools: ['read_query', 'write_query', 'create_table', 'list_tables', 'describe_table', 'append_insight'][SYSTEM] MCP client successfully initializedEnter your prompt (or 'quit' to exit): list tables in database.[USER INPUT] list tables in database.[MODEL INPUT] system: You are a helpful assistant capable of accessing external functions and engaging in casual chat. Use... user: list tables in database. tools: ['read_query', 'write_query', 'create_table', 'describe_table', 'append_insight'][MODEL OUTPUT] content: tool_calls: [ChatCompletionMessageToolCall(id='call_s54x4tgp', function=Function(arguments='{"query":"SELECT name FROM sqlite_mast er WHERE type=\'table\';"}', name='read_query'), type='function', index=0)][TOOL INPUT] read_query: { "query": "SELECT name FROM sqlite_master WHERE type='table';"}[TOOL OUTPUT] read_query: [{'name': 'tbl_test'}][MODEL INPUT WITH TOOL RESULTS] system: You are a helpful assistant capable of accessing external functions and engaging in casual chat. Use... user: list tables in database. assistant: tool: "[{'name': 'tbl_test'}]"[MODEL FINAL OUTPUT] content: Great! It looks like there's one table in your database named **`tbl_test`**.Would you like to see more details about this table, such as its columns and their data types? You can do that by describing the tab le. Just let me know how you'd like to proceed!Response: Great! It looks like there's one table in your database named **`tbl_test`**.Would you like to see more details about this table, such as its columns and their data types? You can do that by describing the tab le. Just let me know how you'd like to proceed!Enter your prompt (or 'quit' to exit): quit시스템 프롬프트에 도구목록과 사용자 질문을 합쳐 모델에 있력하면,
모델이 도구에 들어갈 json 명령을 작성하고,
호스트가 json 을 잘라서 서버로 던지고,
결과받고,
모델에 결과던지면
모델이 최종 출력을 내서 제출…
결론적으로…
json 작성할 능력있는 모델은
MCP 적용 가능하다…
모델에 최신 정보 또는 신규기능을 집어 넣을 수 있는 방법이 생겼다…
하지만, 모델이 현실 세계를 건드릴 통로도 생겼다…