# file-manager-webmcp

> File manager with WebMCP enabled, registering its file operations as tools and handling tool calls.

**Framework:** vue  **Component:** FileManager  **Variant:** webmcp

## Get this item

**If you are an agent, fetch the JSON.** Source is inlined, so one request is enough and no tooling is required:

```
GET https://ai.syncfusion.com/r/vue/file-manager-webmcp.json
```

**Install Package(s)**

```bash
npm install @syncfusion/ej2-vue-filemanager
```

**Notes**

- Syncfusion release: 2026 Volume 3 (v35.1.37)
- The Syncfusion package is licensed. The composition in this file is source you own and edit. See https://ai.syncfusion.com/licensing.md

## Source files

### src/components/file-manager-webmcp/FileManager.vue

```vue
<template>
  <div class="control-section file-webmcp">
    <div class="sample-container">
      <ejs-filemanager
        id="filemanager"
        :ajaxSettings="ajaxSettings"
        :enableWebMcp="true"
        :webMcpSettings="webMcpSettings"
        :beforeWebMcpToolExecute="beforeWebMcpToolExecute"
      />
    </div>
  </div>
</template>

<script lang="ts">
import { FileManagerComponent, NavigationPane, DetailsView, Toolbar, WebMcpFileManager } from '@syncfusion/ej2-vue-filemanager';

const hostUrl = 'https://physical-service.syncfusion.com/';

export default {
  components: {
    'ejs-filemanager': FileManagerComponent
  },
  data() {
    return {
      ajaxSettings: {
        downloadUrl: hostUrl + 'api/FileManager/Download',
        getImageUrl: hostUrl + 'api/FileManager/GetImage',
        uploadUrl: hostUrl + 'api/FileManager/Upload',
        url: hostUrl + 'api/FileManager/FileOperations'
      },
      webMcpSettings: {
        name: 'explorer',
        tools: ['getSelectedFiles', 'manageFileSystemItems', 'manageFileUploadAndDownload'],
        exposedTo: ['https://www.syncfusion.com/']
      }
    };
  },
  provide() {
    return {
      filemanager: [NavigationPane, DetailsView, Toolbar, WebMcpFileManager]
    };
  },
  methods: {
    beforeWebMcpToolExecute(args: any) {
      // Example business rule
      if (args.toolName.includes('manageFileSystemItems')) {
        const hour = new Date().getHours();
        if (hour < 9 || hour > 17) {
          args.cancel = true;
          console.log(
            'File system operations are allowed only between 9:00 AM and 5:00 PM.'
          );
        }
      }
    }
  }
};
</script>

<style scoped>
.file-webmcp .sample-container {
  margin: 10px 10px 10px 10px;
}
</style>

```
