You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was able to configure and run mcphost with qwen2.5-coder. The model was able to list all the available tools but it was not informed in which situation to use them. I asked the model to write a simple Python code and save it to a file. The model has written the code, but instead of saving it to a file it provided me with another Python script that would save the first Python script to a file. So the model is not aware that it can access a specific tool for this purpose until I mention it explicitly. The last failure to write the file was due to misconfiguration of the allowed path for the filesystem server.
It seems that some information on that should be added to the system prompt during registration of tools.
Here is a complete log of the run.
`> mcphost --model ollama:qwen2.5-coder:7b-instruct
2025/01/16 12:52:08 INFO Model loaded provider=ollama model=qwen2.5-coder:7b-instruct
2025/01/16 12:52:08 INFO Initializing server... name=sqlite
2025/01/16 12:52:09 INFO Initializing server... name=filesystem
2025/01/16 12:52:10 INFO Server connected name=sqlite
2025/01/16 12:52:10 INFO Server connected name=filesystem
2025/01/16 12:52:10 INFO Tools loaded server=sqlite count=6
2025/01/16 12:52:10 INFO Tools loaded server=filesystem count=9
You: write a Python code to add all uneven numbers from 1 to 191. Write it to file test_sum.py in the default dir.
Assistant:
To accomplish this task, you can follow these steps:
Create a new Python script named test_sum.py.
Write a function that calculates the sum of all odd numbers from 1 to 191.
Save the content of this function to the test_sum.py file.`
Here is the Python code:
# test_sum.py
def sum_of_odd_numbers():
total = 0
for number in range(1, 192):
if number % 2 != 0:
total += number
return total
result = sum_of_odd_numbers()
print(f"The sum of all odd numbers from 1 to 191 is: {result}")
To write this code to the file test_sum.py in the default directory, you can use the following Python script:
# Write the content to test_sum.py
code_to_write = """
# test_sum.py
def sum_of_odd_numbers():
total = 0
for number in range(1, 192):
if number % 2 != 0:
total += number
return total
result = sum_of_odd_numbers()
print(f"The sum of all odd numbers from 1 to 191 is: {result}")
"""
with open('test_sum.py', 'w') as file:
file.write(code_to_write)
print("Code has been written to test_sum.py")
When you run the second script, it will create test_sum.py in the default directory and write the required Python
code into it.
You: When I ask you to write file I mean: call filesystem__write_file tool and supply dir, file name and it context as args. Now write the code you have just generated to test_sum.py in ~/mcp_workplace.
Assistant:
2025/01/16 13:53:48 INFO 🔧 Using tool name=filesystem__write_file
Assistant:
2025/01/16 14:15:08 INFO 🔧 Using tool name=filesystem__write_file
Assistant:
It seems that the ~/mcp_workplace and its subdirectories are not within the allowed access list. If you have write
permissions to a specific directory, please provide me with the correct path where I can create the file for you.
Otherwise, if you cannot specify a different path, I suggest creating a temporary file in one of the allowed
directories instead.
The text was updated successfully, but these errors were encountered:
i faced the same thing. it seems, if mcp server is installed in C: drive then it can access and execute proper file operations., but if you put some other drive apart from C:, it will show that "outside directory..." error.
I have the same issue with ollama:incept5/llama3.1-claude.
It was asked to list directories but was unable to do so.
Then I tried to play with Slack integration, and it looks like the model sees the tools and even tries to call them but is unable to retrieve the result.
Updated
Slack integration works with the default model but does not work with ollama
I was able to configure and run mcphost with qwen2.5-coder. The model was able to list all the available tools but it was not informed in which situation to use them. I asked the model to write a simple Python code and save it to a file. The model has written the code, but instead of saving it to a file it provided me with another Python script that would save the first Python script to a file. So the model is not aware that it can access a specific tool for this purpose until I mention it explicitly. The last failure to write the file was due to misconfiguration of the allowed path for the filesystem server.
It seems that some information on that should be added to the system prompt during registration of tools.
Here is a complete log of the run.
`> mcphost --model ollama:qwen2.5-coder:7b-instruct
2025/01/16 12:52:08 INFO Model loaded provider=ollama model=qwen2.5-coder:7b-instruct
2025/01/16 12:52:08 INFO Initializing server... name=sqlite
2025/01/16 12:52:09 INFO Initializing server... name=filesystem
2025/01/16 12:52:10 INFO Server connected name=sqlite
2025/01/16 12:52:10 INFO Server connected name=filesystem
2025/01/16 12:52:10 INFO Tools loaded server=sqlite count=6
2025/01/16 12:52:10 INFO Tools loaded server=filesystem count=9
You: Which MCP tools are available to you?
Assistant:
The available tools include:
• sqlite__read_query
• sqlite__write_query
• sqlite__create_table
• sqlite__list_tables
• sqlite__describe_table
• sqlite__append_insight
• filesystem__read_file
• filesystem__read_multiple_files
• filesystem__write_file
• filesystem__create_directory
• filesystem__list_directory
• filesystem__move_file
• filesystem__search_files
• filesystem__get_file_info
• filesystem__list_allowed_directories
You: write a Python code to add all uneven numbers from 1 to 191. Write it to file test_sum.py in the default dir.
Assistant:
To accomplish this task, you can follow these steps:
Here is the Python code:
To write this code to the file test_sum.py in the default directory, you can use the following Python script:
When you run the second script, it will create test_sum.py in the default directory and write the required Python
code into it.
You: When I ask you to write file I mean: call filesystem__write_file tool and supply dir, file name and it context as args. Now write the code you have just generated to test_sum.py in ~/mcp_workplace.
Assistant:
2025/01/16 13:53:48 INFO 🔧 Using tool name=filesystem__write_file
Assistant:
2025/01/16 14:15:08 INFO 🔧 Using tool name=filesystem__write_file
Assistant:
It seems that the ~/mcp_workplace and its subdirectories are not within the allowed access list. If you have write
permissions to a specific directory, please provide me with the correct path where I can create the file for you.
Otherwise, if you cannot specify a different path, I suggest creating a temporary file in one of the allowed
directories instead.
The text was updated successfully, but these errors were encountered: